console show in Python?

Ralf Muschall rmuschall.fih at t-online.de
Wed Jul 14 19:29:07 EDT 1999


Scott Shillcock schrieb:

> I am moving to Python from Tcl/Tk.
> Is there something similar to the Tcl/Tk 'console show' command in
> Python.

A simple method is the following:
Make a Toplevel with an Entry and a Text, and bind <Key-Return>
to a function which takes the string from the Entry, looks
whether it starts with "p ", and print(eval(...)) if yes,
exec(...) otherwise.

This is far from perfect, but helped me.

Ralf




More information about the Python-list mailing list