Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78837 > unrolled thread

how to add custom importer after the normal imports

Started byGelonida N <gelonida@gmail.com>
First post2014-10-08 12:53 +0200
Last post2014-10-08 12:53 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  how to add custom importer after the normal imports Gelonida N <gelonida@gmail.com> - 2014-10-08 12:53 +0200

#78837 — how to add custom importer after the normal imports

FromGelonida N <gelonida@gmail.com>
Date2014-10-08 12:53 +0200
Subjecthow to add custom importer after the normal imports
Message-ID<mailman.14681.1412765637.18130.python-list@python.org>
Hi,


I just read about sys.meta_path, which allows to install custom 
importers *BEFORE* the default importers.

However I have a use case where I would like to add a custom importer 
*AFTER* all other import methods have failed.

Does anybody know how to do this.

One way of implementing this would be to add the default importer as 
first entry in sys.meta_path. My only problem is, that I don't know how 
to create a 'default-importer', such that I can add it into sys.meta_path

Thanks in advance for any suggestions

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web