November 6th, 2004, 09:11 AM
Console window troubles
I recently installed python under windows98. When I click a .py file python tries to run it. If there is an error it gets reported in a console window but the window closes before I can read the error message. How can I get the window to remain open long enough to see what is wrong?
November 6th, 2004, 11:12 AM
Unless you modify the program to catch the exception/erorr and redisplay it you can't
The simplest/best thing is to open a console (DOS box) and change directory to the directory containing the program and run it from there.
Most bugs/ issues like this can also be found uisng IDLE (open the file and press F5). However, this won't catch all bugs and can actually hide them.
November 6th, 2004, 06:13 PM
You can also run Python with the -i command option – of which I am a big fan! This lets you run the program as normal then gives you a Python shell prompt (>>>) that you can use to try the program/code-block/function from right there . Handy for debugging .
November 6th, 2004, 08:17 PM
console window troubles
What is IDLE and how do I use it? I have it as a shortcut but when I click on it nothing happens.
November 7th, 2004, 02:51 AM
IDLE is a Integrated Development Environment - in this case that means a Windows based Python command shell and Script editor.
Assuming you have installed Python 2.2 or 2.3....
If you have a shortcut already to IDLE it should be like this:
when you right click it to examine its properties. The drive will change to reflect where you installed Python of course.
Confirm that it is correct by browsing that directory and checking the file exists.
If it is correct and clicking on it does not work then it means Python has not been registered as an application to launch py or pyw files. If that is the case then it's probably easiest to re-install Python and try again.
Or locate a python file (a .py or pyw file) and view it's properties - on WinXp you can associate a c:\python23\python.exe with the files so that Windows knows to use it (I don't have a Win98 machine to confirm it's equivalent).
Last edited by Grim Archon; November 7th, 2004 at 02:53 AM.