Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Alan Gauld


"Dick Moores" <[EMAIL PROTECTED]> wrote 


OK, let's eliminate some variables and go back to getting
the python script working.


Remember, it does work.


Not if it doesn't close down cleanly. In my book that's broken!


I've used turtle many times and never seen this behaviour
before. What does the code look like?





I can't see anything that would cause this(*) but it might be 
interesting to add some debugging print statements to see 
what happens to the loop counters etc when you try to 
close the window.


(*) I see a few other things that raise my eyebrows but not 
that cause this... :-)


Alan G.


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Kent Johnson
On Mon, Jul 28, 2008 at 4:44 PM, Dick Moores <[EMAIL PROTECTED]> wrote:
> Win XP, Python 2.51
>
> The script is at   It calls the
> Windows console to show the printed data.
>
> I've successfully used PyInstaller to make an .exe for this.  For informed
> users, exiting the program before it finishes is easily and cleanly done by
> a Ctrl+Q on the console window.
>
> But I'd like to make a version of the script that doesn't report any data.
> How can I write it so that the .exe can be easily exited by the user? If
> Tkinter instead of Turtle were involved, I could have an Exit button
> connected to command=root.quit .

Take a look at the source for the turtle module (in
Python/Lib/lib-tk/turtle.py I think). It has a global _root object
which is the Tk instance.

You could make your own Pen class, subclassing from RawPen, that makes
whatever kind of window you would prefer. Then instead of using the
module functions forward(), down(), etc - which just delegate to a
global Pen instance - make an instance of your own pen and draw with
that.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Dick Moores

At 12:38 AM 7/29/2008, Alan Gauld wrote:


"Dick Moores" <[EMAIL PROTECTED]> wrote


Very odd, I assume the python script when executed normally
doesn't exhibit such odd behaviour?


When I try to stop the script from running not by a Ctrl+Q on the 
console window, but on the Turtle window, the only way is to use 
the Task Manager.


OK, let's eliminate some variables and go back to getting
the python script working.


Remember, it does work.


I've used turtle many times and never seen this behaviour
before. What does the code look like?




Dick
===
Have you seen Kelie Feng's video introducing the terrific and free
IDE, Ulipad? 
Get Ulipad 3.9 from 
svn for the latest revision 
Mailing list for Ulipad:  


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Alan Gauld


"Dick Moores" <[EMAIL PROTECTED]> wrote


Very odd, I assume the python script when executed normally
doesn't exhibit such odd behaviour?


When I try to stop the script from running not by a Ctrl+Q on the 
console window, but on the Turtle window, the only way is to use the 
Task Manager.


OK, let's eliminate some variables and go back to getting
the python script working.

I've used turtle many times and never seen this behaviour
before. What does the code look like?

Alan G. 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-28 Thread Dick Moores

At 05:30 PM 7/28/2008, Alan Gauld wrote:


"Dick Moores" <[EMAIL PROTECTED]> wrote


Tkinter is involved, turtle usesw Tkinter.


Yes, I allowed for that when I made the .exe:
python Makespec.py -FKc 
E:\PyInstaller\MyScripts\randomTriangles_wo_named_colorsV13.exe


Means nothing to me, I've never found a need to make an exe
from a python program... :-)


But to exit I would expect the standard Windows exit key
combination (Alt F4) to work fine?


Yes, but no. Try it yourself. Please. 



Very odd, I assume the python script when executed normally
doesn't exhibit such odd behaviour?


When I try to stop the script from running not by a Ctrl+Q on the 
console window, but on the Turtle window, the only way is to use the 
Task Manager.



The only way I could stop
it was to kill the process from Task Manager.


Yes.


 Are you sure you
aren't generating some kind of autostart option in your exe
building tool?


Well, since the behavior of the .exe is exactly the same as that of 
the running script, I'd say that isn't happening.



I have no further ideas...


Well, thanks for trying, Alan.

Dick


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-28 Thread Alan Gauld


"Dick Moores" <[EMAIL PROTECTED]> wrote


Tkinter is involved, turtle usesw Tkinter.


Yes, I allowed for that when I made the .exe:
python Makespec.py -FKc 
E:\PyInstaller\MyScripts\randomTriangles_wo_named_colorsV13.exe


Means nothing to me, I've never found a need to make an exe
from a python program... :-)


But to exit I would expect the standard Windows exit key
combination (Alt F4) to work fine?


Yes, but no. Try it yourself. Please. 



Very odd, I assume the python script when executed normally
doesn't exhibit such odd behaviour? The only way I could stop
it was to kill the process from Task Manager. Are you sure you
aren't generating some kind of autostart option in your exe
building tool?

I have no further ideas...

Alan G. 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-28 Thread Dick Moores

At 03:32 PM 7/28/2008, Alan Gauld wrote:


"Dick Moores" <[EMAIL PROTECTED]> wrote

But I'd like to make a version of the script that doesn't report 
any data. How can I write it so that the .exe can be easily exited 
by the user? If Tkinter instead of Turtle were involved, I could 
have an Exit button connected to command=root.quit .


Tkinter is involved, turtle usesw Tkinter.


Yes, I allowed for that when I made the .exe:
python Makespec.py 
-FKc  E:\PyInstaller\MyScripts\randomTriangles_wo_named_colorsV13.exe



But to exit I would expect the standard Windows exit key
combination (Alt F4) to work fine?


Yes, but no. Try it yourself. Please. 



Dick


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-28 Thread Alan Gauld


"Dick Moores" <[EMAIL PROTECTED]> wrote

But I'd like to make a version of the script that doesn't report any 
data. How can I write it so that the .exe can be easily exited by 
the user? If Tkinter instead of Turtle were involved, I could have 
an Exit button connected to command=root.quit .


Tkinter is involved, turtle usesw Tkinter.

But to exit I would expect the standard Windows exit key
combination (Alt F4) to work fine?

Alan G 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Turtle problem: how to exit the .exe?

2008-07-28 Thread Dick Moores

Win XP, Python 2.51

The script is at   It 
calls the Windows console to show the printed data.


I've successfully used PyInstaller to make an .exe for this.  For 
informed users, exiting the program before it finishes is easily and 
cleanly done by a Ctrl+Q on the console window.


But I'd like to make a version of the script that doesn't report any 
data. How can I write it so that the .exe can be easily exited by the 
user? If Tkinter instead of Turtle were involved, I could have an 
Exit button connected to command=root.quit .


Thanks,

Dick Moores

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor