py2bat (was: How do I make a Python .bat executable file?)

Pieter Claerhout PClaerhout at CREO.BE
Thu Jan 6 12:07:52 EST 2000

Try making a .cmd or a .bat file (you can choose), and put the following
line at the top of this cmd file:

@python -x %~f0 %* & goto :EOF

Paste your python script after that, and this should work. However, there
are three things you have to keep in mind:

- You need to have Python installed
- Don't put such a script in a path where there are spaces in the path
- This doesn't work with Windows 95/98

I also attached a script that converts your .py file to the according .cmd file.

Kind regards,


Pieter Claerhout - PClaerhout at
Response Center - Applications Support

Creo Europe - Excelsiorlaan 21 - 1930 Zaventem - Belgium
Tel: +32 (2) 711 14 00 - Fax: +32 (2) 720 96 71

-------------- next part --------------
A non-text attachment was scrubbed...
Name: py2cmd.cmd
Type: application/octet-stream
Size: 683 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list