mike | Shared With: Everyone - Jul 22 2008 | windows, cmd, command, python, extension
Hack for getting python scripts to run like cmd files - including the ability to redirect stdio (I can't believe this bug in windows cmd processor - Windows really sucks for command line types).
Quoted: On Windows NT, the steps taken by the installer as described above allow you to run a script with 'foo.py', but a longtime bug in the NT command processor prevents you from redirecting the input or output of any script executed in this way. This is often important.
...
The incantation for making a Python script executable under WinNT is to give the file an extension of .cmd and add the following as the first line:
...
@setlocal enableextensions & python -x %~f0 %* & goto :EOF
Related Content from Around Faves
python
-
1 FaverViewed: 3 TimesQuoted: To test the Python and PLY environment, Shannon wrote a language called "Squeamish" that consists of only 850 lines of code.
- falko - Jul 24 20081 FaverViewed: 14 Times
- mike - 18 days ago2 FaversViewed: 1 Time
