Re: simple import hook

2011-11-14 Thread DevPlayer
An alternative approach: http://pastebin.com/z6pNqFYE or: # devpla...@gmail.com # 2011-Nov-15 # recordimports.py # my Import Hook Hack in response to: # http://groups.google.com/group/comp.lang.python/browse_thread/thread/5a5d5c724f142eb5?hl=en # as an initial learning exercise # This code

simple import hook

2011-11-10 Thread Andrea Crotti
So I would really like to accomplish the following: run a program normally and keep track of all the imports that were actually done. I studied the PEP 302, but I'm still a bit confused about how to do it. I thought that instead of implementing everything I could just record the request and

Re: simple import hook

2011-11-10 Thread Andrea Crotti
On 11/10/2011 05:02 PM, Eric Snow wrote: Yeah, I'm working on a reference for imports in Python. They're just a little too mysterious relative to the rest of the language. But it's not too helpful yet. In the meantime... Yes it's quite mysterious, and it's actually not as hard as it looks..