PyCrust sets the standard for a Python shell

When you work with Python interactively, you work in an environment that is called the Python shell which is similar to other shell environments, such as the DOS window on Microsoft platforms, or the bash command line on Unix-based systems.

The most basic of all the Python shells is the one in listing 4.1, which you see when you launch Python from the command line. While it is a useful shell, it is strictly text-based, rather than graphical, and it doesn't provide all the shortcuts or helpful hints that Python is capable of providing. Several graphical Python shells have been developed that provide this additional functionality. The most well-known is IDLE, the Integrated DeveLopment Environment that is a standard part of the Python distribution. IDLE's shell, as seen in figure 4.1, looks much like the command line Python shell, but has additional graphical features such as calltips.

Other Python development tools, such as PythonWin and Boa Constructor, include graphical Python shells similar to the one in IDLE. It was the existence of all these shells that prompted the creation of PyCrust. While each tool's shell had some useful features, such as command recall, autocompletion, and calltips, no tool had a complete set of all the features. One of the goals of PyCrust was to support a complete set of all the existing Python shell features.

Figure 4.1 IDLE's shell provides calltips for functions and methods

The other motivation for creating PyCrust was that tools written using one GUI toolkit often cannot work with code from a different GUI toolkit. For example, IDLE is written using Tkinter, not wxPython. Until recently, if you tried to import and use a wxPython module from within IDLE's Python shell, you would be caught in a conflict between the event loop for wxPython and the event loop for Tkinter, resulting in a frozen or crashed program.

In effect, the two toolkits fought to have control over the event loop. So if you want runtime introspection features that work with wxPython modules, your Python shell must be written using wxPython. Since there wasn't an existing Python shell that supported a complete feature set, PyCrust was created to fill that need.

Was this article helpful?

+5 -2


  • franziska
    How to use stander pyton commands with wxpython?
    8 years ago
  • lara
    What is pycrust used for?
    2 years ago
  • annett
    How to use pycrust in python scripting?
    2 years ago

Post a comment