[Edu-sig] How to explore Tkinter interactively with IDLE 1.0
Gregor Lingl
glingl at aon.at
Fri Sep 26 18:30:43 EDT 2003
Guido van Rossum schrieb:
>This is because under IDLE 1.0, Tkinter programs don't get to benefit
>from IDLE's Tkinter mainloop. Tkinter programs written for use
>outside IDLE runs fine under the new IDLE, because such programs
>already have an explicit call to the Tkinter mainloop (otherwise they
>wouldn't function at all). Under IDLE 0.8, such programs, once started,
>would be hard to stop because their mainloop and IDLE's mainloop would
>compete. But interactively playing with Tkinter has become harder.
>
>So, the new IDLE, conforming one of its design goals, has actually
>become more compatible with Tkinter applications -- but at the same
>time the unique IDLE 0.8 feature of easy interactive Tkinter
>experimentation has gone out of the window.
>
>A work-around is to use the -n command line argument to idle (a bit
>tricky to invoke on Windows but you should be able to add this to the
>IDLE alias or create a batch file for it), which runs the Python code
>in the IDLE process as in IDLE 0.8 (with all the risks of that mode,
>like losing data in IDLE when the app crashes or hangs).
>
>
Hi Guido, thanks for your reply. For experimentation with Tkinter I do
use IDLE with the -n switch
in my classes.
>Perhaps this could be made a more easily configurable option (a
>checkbox or radio button in the General configurations dialog would
>seem the right place).
>
The dream of any teacher would be, of course, to have a menu-switch to
flip between the two
modes without the need to restart IDLE. But probably this would be hard
to implement.
>Do we need something else? Perhaps some trick that you can invoke
>that runs a Tkinter mainloop in a background thread? (But note that
>Tkinter and threads don't go well together.)
>
Doesn't Tkinter claim to be threadsafe? (The few simple programs I
wrote, whith several
threads drawing on the same Canvas showed no problems.)
However there is a different point: In my classes I use the -Qnew switch
for the Python interpreter (and also in my book, as you already noticed,
when you read some excerpts of it) and this works fine with IDLE -n, but,
alas, it doesn't work with IDLE 1.0 in standard mode. Is this a feature
or a bug?
So what about a switch - or at least also a configuration option - for
the new division?
Regards,
Gregor
>
>--Guido van Rossum (home page: http://www.python.org/~guido/)
>
>_______________________________________________
>Edu-sig mailing list
>Edu-sig at python.org
>http://mail.python.org/mailman/listinfo/edu-sig
>
>
>
>
More information about the Edu-sig
mailing list