A new template to embed python sctipt in ms-dos script Thursday, March 25, 2010




@echo off
rem = """-*-Python-*- script
rem -------------------- DOS section --------------------
rem You could set PYTHONPATH or TK environment variables here
python -x %~f0 %*
goto exit

"""
# -------------------- Python section --------------------
import sys

print sys.argv[0]


DosExitLabel = """
:exit
rem """