Shebang Notation: Python Scripts on Windows and Linux? -


i have small utility scripts written in python want usable on both windows , linux. want avoid having explicitly invoke python interpreter. there easy way point shebang notation correct locations on both windows , linux? if not, there way allow implicit invocation of python interpreter on both windows , linux without having modify script when transferring between operating systems?

edit: shebang support on windows provided cygwin, want use native windows python interpreter on windows, not cygwin one.

edit # 2: appears shebang notation overrides file associations in cygwin terminals. guess uninstall cygwin python , symlink /usr/bin/python windows-native python.

unless using cygwin, windows has no shebang support. however, when install python, add file association .py files. if put name of script on command line, or double click in windows explorer, run through python.

what include #!/usr/bin/env python shebang in scripts. allows shebang support on linux. if run on windows machine python installed, file association should there, , run well.


Comments