making a python program in windows

Martin P. Hellwig martin.hellwig at
Thu May 21 06:19:58 EDT 2009

Rustom Mody wrote:
> I know how to make a python script behave like a (standalone) program
> in unix --
> 1. put a #! path/to/python as the first line
> 2. make the file executable
> The closest I know how to do this in windows is:
> r-click the file in win-explorer
> goto properties
> goto open with
> change pythonw to python
> Can someone enlighten me about a more scriptish way of doing this?
> Basically if I have to setup that program on other (windows) m/cs is
> there some .bat or .vbs or some regedit thingy Ive to do to avoid the
> Rt-click routine?

Since you don't know for sure if a Python environment is available on 
the other windows machine and whether the file associations are 
configured correctly, the best thing you can do is to use something like 
py2exe and distribute the result of that.

'If consumed, best digested with added seasoning to own preference.'

More information about the Python-list mailing list