> 1) Create an initial sys.path but without its first item. > 2) Import site, os, sitecustomize, etc. > 3) Insert a new item as sys.path[0]. This will not work for a frozen MacPython program. In such a program the sys.path initializer is ["$(APPLICATION)"]. So, there's no empty current directory entry in sys.path[0], the only thing in sys.path is the magic cookie "$(APPLICATION)". Early in startup, before site.py is imported, the cookie is replaced by the full pathname of the application. The import code knows that if it sees a file on sys.path (as opposed to a directory) it will look in that file for frozen PYC resources. And, before you ask, I'm aware that in the future this code will have to test whether or not the file has a .zip extension, and go down the zip-import leg if it has. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm
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