Benutzer-Werkzeuge

Webseiten-Werkzeuge


start

Dies ist eine alte Version des Dokuments!


GuiPy

GuiPy is a Python IDE for teachers and students. Most Python IDEs only support text-based coding, GuiPy instead has several graphical tools to aid in learning and teaching Python programming concepts. GuiPy has these graphical tools:

  • GUI designer for Tkinter and TTK
  • Class modeler for modelling classes with attributes and methods
  • UML window with classes and their connections. You can create objects by calling the constructor. Methods of objects can be called interactively.
  • Structogram editor for creating strutograms and converting them into Python code.
  • Sequence diagram editor for modelling sequence diagrams with lifelines an activations.

Class Modeler

With class modeler you can create new classes and edit existing classes. It reads python source files and displays them as classes with attributes and methods. Changes in the class modeler are transferred accordingly to the python source files. The class modeler is an easy to use tool for modelling classes.

The order of attributes and methods in the structure tree can be changed by drag&drop.

Call the class modeler using the icon in the editor window. You can also double-click the required class in the UML window or use the context menu to call up the class modeler.

UML Window

After you've modeled a class with the class modeler, it's time to test your model. In the uml window, you can right-click to open a class's context menu to invoke the constructor to create an object interactively.

If you then invoke the context menu of the created object, you can edit the attributes and invoke the methods of the object. Changed attribute values are easy to see, and objects created by a method call are immediately visible. This is particularly useful when working with dynamic data structures such as lists and trees.

GUI Designer

After testing your model in the uml window you can use it in a console or GUI program.

It's quite difficult to design graphical user interfaces when using layout managers. Students really don't like this because it's much easier to drag and drop GUI components to the desired position on a form. So, GuiPy's GUI designer uses absolute positioning, which allows you to design your layout pretty quickly.

To create a GUI program, click the icon on the „Program“ tab. This provides a skeleton program in an editor window and a GUI form.

To place a GUI component, first click its icon on the Tkinter or TTK tab and then click in the GUI form. Alternatively, you can drag and drop a GUI component from a tab onto your GUI form. You can then position the GUI component and configure it using the Object Inspector. The source code is synchronized accordingly.

With the symbol of a source code editor you open the corresponding GUI form.

The GUI form has a context menu for editing the components.

Struktogram editor

GuiPy verfügt über einen Struktogrammeditor, mit dem Struktogramme erstellt und bearbeitet werden können.

Die Modellierung von Abläufen mit Struktogrammen auf einer programmiersprachlich unabhängigen Ebene spielt im Informatikunterricht eine wichtige Rolle, weil Algorithmen auf einer abstrakten Ebene ohne konkrete programmiersprachliche Details modelliert werden können. Ein Algorithmus kann verstanden werden, ohne dass man ihn selbst in Python programmieren kann. Händisches Zeichnen von Struktogrammen auf Papier bringt keine ansehlichen Ergebnisse, weil Strukturänderungen praktisch nicht möglich sind. Mit dem Struktogrammeditor können Struktogramme einfach, schnell und korrekt erstellt werden. Aus Struktogrammen kann Python-Quellcode generiert werden, der aber dann noch nach bearbeitet werden muss. Dies unterstützt beim Implementieren in Python.

Der umgekehrte Weg geht auch. Im Editor kann man Quelltext auswählen und daraus ein Struktogramm erzeugen lassen.

Per Drag&Drop können Struktogrammelemente in ein Struktogramm eingefügt und aus einem Struktogramm herausgezogen werden. Zieht man ein Strktogrammelement nach unten, werden alle darauf folgenden Elemten auch mitabgetrennt. Aus der linken Symbolleiste lassen sich Struktogramelemente herausziehen, zum Löschen kann man sie zurück auf die Symbolleiste ziehen. Leere Struktogrammelemente klickt man an und tippt den Text einfach ein. Zum nachträglichen Editieren doppelklickt man den betreffenden Text.

Das grüne P erzeugt aus dem Struktogramm soweit möglich eine Pythonfunktion. In der Konfiguration können die im Struktogramm verwendeten Texte angepasst werden.

start.1643202166.txt.gz · Zuletzt geändert: 2022/01/26 14:02 von roehner