why _import__ only works from interactive interpreter?

linuxnow at gmail.com linuxnow at gmail.com
Sun May 7 19:21:01 EDT 2006


It's not that, it looks like __import__looks into sys.path, so
                                                if use an absolute path
it cannot work.

I found this thread and it seems they are right:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/6eed0025488bf130/637790b4ed62771b?lnk=st&q=__import__+ImportError+interpreter&rnum=1#637790b4ed62771b

So, if this is right, I need to put the .py file to be imported inside
sys.path!! And the relative path will be usedto find the module.

Can I __import__ providing the absolute path?

Thanks
Pau




More information about the Python-list mailing list