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/2007-September/074581.html below:

[Python-Dev] Making directories and zip files executable

[Python-Dev] Making directories and zip files executable [Python-Dev] Making directories and zip files executableNick Coghlan ncoghlan at gmail.com
Wed Sep 12 11:19:35 CEST 2007
Guido van Rossum wrote:
> I could use a refresher on how PJE's patch solves Andy's problem.

I'm not sure if you're asking about how you would execute a zip file 
after the patch has been applied, or about the mechanics of how the 
patch works. PJE's last post covered the former question, so I'll cover 
the gist of the latter.

The patch works by passing the script argument to the import machinery 
to see if it is recognised as a valid sys.path entry (i.e. either a 
directory or a zip file in a default Python installation). If it is, 
then add that location to the front of sys.path and use the -m switch 
support to execute the "__main__" module directly.

If the filename passed in isn't recognised as a sys.path entry, then it 
is executed as a script as normal.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
More information about the Python-Dev mailing list

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