Skip to content

Instantly share code, notes, and snippets.

@heetbeet
Last active August 27, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heetbeet/f80f5029b9f17a81cc17ba903aac1ad3 to your computer and use it in GitHub Desktop.
Save heetbeet/f80f5029b9f17a81cc17ba903aac1ad3 to your computer and use it in GitHub Desktop.
A Linux/Windows header to run a file (with .bat extension) as a Python script. Python must be in os path.
""" " 2>NULL & @echo off 2>/dev/null
:; /usr/bin/env python "$0" "${@}"; exit $?
@echo off & call python %0 %* & exit /b
"""
print('hello')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment