Expand|Select|Wrap|Line Numbers
- ~pwd
- /home/preyan/test
- ~ls
- sample.py
- ~python
- >>> mod=__import__('sample')
- >>> amod=__import__('/home/preyan/test/sample')
- >>>
Expand|Select|Wrap|Line Numbers
- # /home/preyan/mypro.py
- mod='sample'
- os.chdir('/home/preyan/test')
- module=__import__(mod)
- Traceback (most recent call last):
- File "/home/preyan/mypro.py", line 3, in <module>
- module=__import__(mod)
- ImportError: No module named sample
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
why is that am not able to import ?.