On 13/07/07, Phillip J. Eby <pje at telecommunity.com> wrote: > After thinking about it some more, I suggest that instead of using a > special option to execute a zipfile, we simply always get an importer > for the script filename. If the importer is imp.NullImporter, then > we do normal script processing. Otherwise, we set set sys.path[0] = > sys.argv[0] = script, and import __main__. > > This will support zipfiles and directories, Windows and Unix, even > using "env" (since no option to the interpreter is required). > > Thoughts? Let me get this right: if I had a one-liner hello.py (containing the line print "Hello, world") all I'd need to do is (1) rename hello.py to __main__.py (2) zip hello.zip __main__.py. Then, python hello.zip would work exactly as python hello.py did previously? Sounds plausible. I'm not entirely clear on the details of the code needed (long day!) - would you be willing to produce a patch? (One major point in favour of the -z patch is that it exists already!) Paul.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4