Contents:
Engines
In PTK multiple independant python interpreters (or engines) can be used simutanously. Each engine has it's own console in the console window and runs in a seperate process. This seperation of the engine process and PTK interface process allows multiple independant sessions to be started, controlled and switched without long running commands blocking the user interface or a crash in a user command causing PTK to close. Ideal for running multiple scripts, using modern multi-core computers. Another advanatge is that PTK can be used to program interactively with other graphical user interface (GUI) toolkits - such as pyQT, Tkinter and pyGTK.Engine types
Engine type | Requires | Description |
---|---|---|
pyEngine | A simple python interpreter running in an external process. If a GUI mainloop is started no further interactition is available until the mainloop exits. | |
wxEngine | An external process engine with a wxPython mainloop running, allowing the user to use wxPython interactively - Recommended engine. | |
Internal | An engine running in the main PTK process. Used for debugging PTK and tool development - Not recommended for normal use. | |
TkEngine | An external process engine with a Tk mainloop running, allowing the user to use Tk interactively. | |
gtkEngine | An external process engine with a GTK mainloop running, allowing the user to use pygtk interactively. | |
qt4Engine | An external process engine with a Qt4 mainloop running, allowing the user to use pyQt4 interactively. | |
pysideEngine | An external process engine with a PySide Qt4 mainloop running, allowing the user to use the PySide Qt4 bindings interactively. |
Note: You must have the relevant GUI toolkit python packages installed (Tk, pygtk or pyQT4) for these engines to be available.
Starting, switching and closing engines
Engines can be started in two ways - via the main toolbar or on the application startup via the EngineManager tool options (edit->preferences, and under the EngineManager->startup engine tab in the preferences dialog.)Most tools only display the information about the 'current engine' this is the engine whose console is selected in the console window, or the engine that is selected in the dropdown list on the engine toolbar. To switch engines either selected a different entry in the dropdown list or select the engines console tab. Tools and toolbars will update automatically to reflect the state of the newly selected engine.
To close an engine you can use the normal python commands (e.g. 'exit()') or close the engines console via it's tab in which case a confirmation dialog will appear.