Raph
Nov 14, 2013 - 16:13
Sorry if the question is very basic. Maybe I overlooked something in the documentation.I tried
import filename
With no luck, whether the filename was x or x.py does not change a thing.
Sorry if the question is very basic. Maybe I overlooked something in the documentation.I tried
import filename
With no luck, whether the filename was x or x.py does not change a thing.
'import' works propely in my enviroment.
a.py
def afunc():
print 'afunc called'
b.py
import a
a.afunc()
Run b.py.
It'll work.
When I try to run b.py, the interpretor stops at "import a" and gives that as an error message:
ImportError: No module named a
Probabily your "a.py" may be "a.py.py"
If so, Delete ".py" extension.
Pythonista automatically add .py extension to its filename.
Yes that did it! Thanks alot. The strange thing is that I tried that before, but I guess at that time the file I wished to import was still in a sub-folder.