python project in 1 file

Dennis Reinhardt DennisR at dair.com
Sun Feb 2 17:11:29 EST 2003


> .... but they are too complicated or aren't working.

I build a subdirectory of files I need below my project and then code

    sys.path = [".", ".\\bin", ".\\bin\\libstd", ".\\bin\\libxtra"]

very early in my code execution (certainly before calling any libraries).
In above, bin is my code and the two lib directories contain the modules I
want.  The "\\" is because I am on Windows and the preferred "/" does not
work here for me.  I determine which files to include based on error
messages and which files to omit based on the non-writing of .pyc files.
Change the details to suit your layout.

This is (1) simple, (2) working, and (3) requires no external packages.

--

Dennis Reinhardt

http://www.dair.com






More information about the Python-list mailing list