Windows versions of Python---pros and cons?

Syver Enstad syver-en+usenet at online.no
Thu Jun 20 19:29:26 EDT 2002


Chris Barker <Chris.Barker at noaa.gov> writes:
> 
> On that note: does anyone know if there is a way to turn a Python
> script
> 
> into something that acts like an application on Windows...without
> resorting to Py2exe and the like. What I want is something just like:
> 
> chmod +x scriptname
> and a #! line at the top 
> 
> on Unix. I want it to work on the windows command line.
> 

Make a text file, save it as something.bat, put the line below in the
first line of the file.

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

Put python code in the lines underneath.

If you're using emacs and want syntax highlighting:

Put
# Local Variables: ***
# mode:python ***
# End: ***

at the end of the file


I think that this only works on win2k because it uses extensions to 
the batch language that is not part of win9x family of os'es.
-- 

Vennlig hilsen 

Syver Enstad



More information about the Python-list mailing list