DOS problem (simple fix??)
Brian van den Broek
bvande at po-box.mcgill.ca
Fri Jan 7 23:07:32 EST 2005
Gavin Bauer said unto the world upon 2005-01-07 15:47:
> My DOS window (running in windows ME) closes the second it finishes
> running my programs. As you can imagine, this makes it hard to see the
<SNIP>
> Thank you, and please make all answers simple enough to be understood
> by a highschool student and his father :) .
Hi Gavin,
you received some solutions. I have another, and a warning about Paul's.
The warning:
Paul suggested looking at IDLE. You should; it's a big improvement over
notepad or the console. But, do you plan to make GUI application with
Tkinter? If so, they will have troubles under IDLE. IDLE itself is a
Tkinter application, so if it runs another Tkinter app, the poor beast
gets confused about which Tkniter commands go where. (If that doesn't
make sense, then you probably aren't yet at a place where it will
matter. So, don't worry about it now.)
Another popular alternative is SciTe. If you are doing your code in
notepad or an interactive window, you really do want to look into an
alternative!
The other solution:
The exact procedure is Windows version specific, but you can change the
behaviour of .py files when they are double clicked. Here's what I do on
my Win version (ME), which, sadly for both of us, we share:
1) Open a file explorer window.
2) Pick Tool->Folder Options from the menu.
3) Select the File Types tab.
4) Select the .py file type in the alphabetical list of file types that
pops up.
5) Click on the Advanced button.
6) Select the Open action.
7) It will start out with something like:
"C:\Python24\python.exe"
Put a -i immediately thereafter. Mine looks like this
"C:\Python24\python.exe" -i "%1" %*
The -i makes .py files when double-clicked within Windows. The rest has
to do with sending command line parameters, but I'd muff it if I tried
to say more ;-)
HTH,
Brian vdB
More information about the Python-list
mailing list