[Tutor] crash - switching between text window andgraphics/gamewindow (high score)

Jacob S. keridee at jayco.net
Thu Apr 28 01:48:49 CEST 2005


> I haven't been following this thread, so apologies in advance if this is
> something you've already done ---
>
> Have you tried running the program from a command prompt?  To do this, go 
> to
> Start-->Run and type 'cmd'.  Then change to the directory with your script 
> in it
> ('cd ' followed by the full directory path), and run the script by typing
> 'python ' followed by the script name.
> (you may need to type something like 'c:\python24\python ' instead, if 
> python is
> not in your path)
>
> The effect of this is that, when the program crashes, you will be left 
> with a
> window showing you (hopefully) some useful error messages.

I tend to look at cool new ways of automation.  For this particular 
inventive idea, I said, how can I make this do what I want?  In the 
documentation somewhere, it tells you that if you add an -i extension to the 
python command, it will end with an interpreter so you can explore the 
current environment.  i.e. all of your variables set in the program won't be 
erased, and you can print them, manipulate them, etc.

So I said to myself, "That's brilliant, let's make it easier to use from the 
Windows environment."
Using the file associations found in folder options--you can get to folder 
options through control panel--you can go to the py extension listed under 
the tab "file types"  If you click on the advanced button, you can copy the 
command for open, paste it to a new function called say, "Run, end with 
interpreter" or something that makes sense to you, and add the -i extension 
in the command.  Then you make the necessary closings of the dialog boxes, 
the display refreshes automatically, and you can right click on a py file to 
see the new command labeled with your equivalent of "Run, end with 
interpreter"  This is cool, because you can click on it, and it acts like 
IDLE without it.

Okay, I'm done and I'll shut up now.
Jacob 



More information about the Tutor mailing list