[IronPython] Handling the import of scripts

Dave Fugate dfugate at microsoft.com
Thu Jan 29 20:03:04 CET 2009

Look into using sys.path_hooks and sys.meta_path (see http://www.python.org/dev/peps/pep-0302/).


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Slutter
Sent: Thursday, January 29, 2009 10:24 AM
To: Discussion of IronPython
Subject: [IronPython] Handling the import of scripts

If there a way for me to intercept when IronPython wants to import a
script, so I can provide the script text through my own ways. I have a
situation where my Python files are not files on the disk, but packed
into a zip file. When I go to run a script I can get the source to
IronPython to run, but, if that script imports another script that is
also in the zip file, I would like to go through my methods of resolving
the file, loading it, and passing it back to IronPython.

Users mailing list
Users at lists.ironpython.com

More information about the Ironpython-users mailing list