How to run Python in Windows w/o popping a DOS box?

Bengt Richter bokr at oz.net
Fri Apr 22 12:10:48 EDT 2005


On 22 Apr 2005 05:29:48 -0700, pyguy2 at gmail.com wrote:

>click on my computer
>Then select tools->folder options->File Types
>
>scroll down the where the py extension is defined, highlight it, click
>on advanced
>then highlight open and hit the edit button.
>
>There you should see python.exe with some other stuff, change it to
>pythonw.exe

>Then, in the future,  if you click on a python program, it should use
>pythonw.exe

This change is NOT a good idea!!

Files with .py should almost always run with a console window.
For an execption to that, you can always change a particular shortcut to
do what you like, including bringing it up in gvim instead of running it.
Or you can change the extension to .pyw to get pythonw.exe association.
Or you can run it manually either way.

>The steps should be roughly similar on different versions of windows.
>
>I always liked the #! syntax of unix, too bad MS doesn't have it. And,
>too bad their command prompt sucks, too bad process creation is heavy,
>too bad . . .
What do you mean by "their command prompt"? The actual prompt of cmd.exe
or the command line interpretation? I agree the latter sucks, but I could
change the shell if I wanted to go to the trouble. Sometimes I run msys.
But the actual shell that starts when I log in could be changed too.

Actually, I don't really like os system info mixed in with application
info, which is what #! lines and other file-tagging magic is. I think
it belongs closely associated with the file, but not in it. Likewise
I don't like the use of current-container-name (file name) as content-name
(which should be a persistent name associated with the content, not with
the latest container that happens to contain a copy). But that's another rant ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list