A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/030838.html below:

[Python-Dev] Another approach for the import mechanism

[Python-Dev] Another approach for the import mechanism [Python-Dev] Another approach for the import mechanismSkip Montanaro skip@pobox.com
Thu, 5 Dec 2002 16:24:55 -0600
    Skip> Remember, a zip file looks like a directory because of its
    Skip> embedded structure.  If you had httplib.zip it would have to
    Skip> contain at least one .py or .so (or .pyd or ...) file.  I think
    Skip> you would insert /some/dir/httplib.zip into sys.path.

Just rereading my own note, I realize you might have components after the
zip file name.  Suppose you had web.zip which contained directories http,
gopher, ftp, and nntp, each of which was itself a package (had a __init__.py
file).  You might modify sys.path like so:

    newdirs = [os.path.join("/some/dir/web.zip", x)
                  for x in "http gopher ftp nttp".split()]
    sys.path.extend(newdirs)

Skip



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