gregor.lingl (1) [Avatar] Offline
#1
Hi Vern,

I just started to enjoy your revision of the Quick Python Book. It will use Python 3.1, right?

I hope to find a bit of time from time to time to help finding errors. smilie

For now I found an incorrect explanation on page 207:

If you want to use Tkinter examples - as well as especially turtle graphics smilie - you have to distinguish two modes of running IDLE.

The one (and on most platforms default) mode is running Python applications in a separate process. In this case you may also run Tkinter apps with their own mainloop(). In this mode apps (run from an editor window) *need* the mainloop() call in order to be able to react to events.

But this mode is not appropriate for using Tkinter interactively (from the Shell-Window).
If you tried this you would experience a problem (what you called also a bug) as discribed in the note. Imho this is not a bug (but I think it's not a feature either smilie ). It's simply an annoying property of IDLE. smilie

If you want to use Tkinter interactively you have to run everything in IDLE's mainloop an thus to use the mode without subprocess (which is less secure for developing programs, of course, as starting a script doesn's clear it's namespace). This mode is set by using the -n switch. It can be recognized my looking for the ==== no subprocess ==== - banner in the shell window.

Interestingly, when I installed Python 3.1 on my Ubuntu machine via Synaptic (which is already available since Karmic koala is out) this mode turned out to be the default mode for IDLE.

The distiction of these two modes was introduced with Python 2.3 and I think it should be mentioned in this note. There are two different modes to run IDLE approriate for different tasks.

I for my part use to use two different shortcuts for starting IDLE in each of these two modes as needed.

On my windows machine with Python 3.1.1 the default mode using the shortcut(Menu) is the mode with subprocesses, but if you rightclick a *.py script, an editor window opens. If you run the program or simply start a shell from this editor window, the shell opens in no subprocess mode.

Will there be another more complete prerelease of The Quick Python Book containing parts of the advanced material?

An whats the deadline for reporting errors?

Best regards,
Gregor
naomi.ceder (134) [Avatar] Offline
#2
Re: note on page 207 concerning use of Tkinter from within IDLE not correct
Hi Gregor,

Sorry for the delay in replying - the automatic watches on this forum are not working. We are in the last stages of proofreading and are about to go into production.

Thanks for the error report, I should have just enough time to get a correction into the text.

Cheers,
Vern