Permalink
Mike on cmd
  • vote
    2
    0 starsmike | Shared With: Everyone - Jul 22 2008 | windows, cmd, command, python, extension
    Windows FAQ

    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

1 - 1 of 1 Faves

Related Content from Around Faves

python

VIEW ALL