linda.s wrote:
> I comment out
> root.mainloop()
> in my windows machine's Python 2.4 IDLE, everything is OK.
> But if I do the same thing in Mac machine's Python 2.4 IDLE,
> I can not see any map.Why?
>   
When you edit a .py file on a windows machine (by right-clicking and 
hitting 'edit with idle')
it starts the IDLE IDE without the subprocess.  This means that whenever 
a program is run in IDLE,
it's run in the same interpreter IDLE uses (this may not be exactly true)
However, if you were to start IDLE from the start menu, and load the 
file by itself, it would have the subprocess
option enabled, where a separate process containing a python interpreter 
that's isolated from IDLE's is run.

Since IDLE is written in TKinter, it has its own mainloop running.
If you're running a program without the subprocess module, and you try 
to use a mainloop in it,
weird things will happen, because your mainloop will conflict with the 
one IDLE's already using.
That's why you can comment out the mainloop on windows files if you 
right-click->edit them.

The reason the subprocess isn't enabled by default on right-click-> edit 
is that it was causing some problem with
windows or something.
There's a way to make it where subprocess is always enabled, but earlier 
discussions on this subject
have suggested that if you need the subprocess to be enabled, you should 
start IDLE independently
and load the program you're testing.

I'm guessing that these problems don't appear on the Mac version, so 
they just have the subprocess
always running.
You can confirm this if you see
=============RESTART==============
in your IDLE shell whenever you run a program.

TK apps need a mainloop to display, so if on Mac it's running in a 
separate process,
it can't use the mainloop IDLE is already running.

HTH,
-Luke
> _______________________________________________
> Tutor maillist  -  [email protected]
> http://mail.python.org/mailman/listinfo/tutor
>
>   

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to