On Tue, Dec 2, 2014 at 11:45 AM, Ethan Furman <et...@stoneleaf.us> wrote: > Put the above somewhere in your path (e.g. /usr/local/bin), make it > executable, and then instead of shebanging your > scripts with `/usr/local/bin/python` you can use `/usr/local/bin/py_main`, > which will load and execute the script, > calling script.main as its last act.
Be aware that this trick (shebanging to a script rather than a binary) isn't specified by the POSIX standard. It works on Linux, but I don't know about other systems. It's a great trick, though. I once had shebangs chained something like three or four levels deep. ChrisA -- https://mail.python.org/mailman/listinfo/python-list