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

Dave

-----Original Message-----
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@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.

-Jeff
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to