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/074668.html below:

[Python-Dev] import file extensions

[Python-Dev] import file extensions [Python-Dev] import file extensions"Martin v. Löwis" martin at v.loewis.de
Fri Sep 14 23:19:49 CEST 2007
> so i'm wondering, is there a quick way to just add another extension 
> to import mechanism? or do i have to write a fully fledged import
> hook?

[this question is off-topic for python-dev]

If recompiling Python is an option, the quick way is to edit the
interpreter, and add that extension.

If that is not an option, but it is an option to put all .pyy files
in a single directory, the quick way is to add an entry to
sys.path_hooks.

If that is also not an option, the quick way is to add an entry to
sys.meta_path.

The best way would be to not use import, but provide a separate
function (e.g. calling it "require").

Regards,
Martin

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