Skip to content

Instantly share code, notes, and snippets.

@wha7
wha7 / python-batchfile.bat
Created September 12, 2019 21:08 — forked from jadient/python-batchfile.bat
Run python code directly from a batch file
@echo off & python -x "%~f0" %* & goto :eof
# ==========================================================
# one way to place python script in a batch file
# place python code below (no need for .py file)
# ==========================================================
import sys
print "Hello World!"
for i,a in enumerate(sys.argv):