I don't know what I'm doing wrong, but the result is that _import_ only
works from a python shell, but not when I call a python script.

$ cat test.py
mod = __import__("/home/me/tests/test_imp")

Called from a script it does not work:
$ python /home/me/test.py
Traceback (most recent call last):
  File "/home/pau/test.py", line 1, in ?
    mod = __import__("/home/me/tests/test_imp")
ImportError: No module named /home/me/tests/test_imp

But if I import it from a python shell, then no problem:
$ python 
>>> import test
>>> 

What am I doing wrong?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to