newbie Python question, 2.7.2 on Windows XP
I saved a one-line hello.py file [print “hello there”] in the current directory.
At the command prompt I use import to run the command
>>> import hello
hello there
ok – that’s fine.
But what do you type if hello.py were in a subfolder of the current directory called “tempFolder”?
Assuming this is your directory structure:
Short Answer:
You should have a
__init__.pyin your directory of import.So it should look like:
Note: the
__init__.pycould be blank. There is no harm in that.Check the official documentation for more information on this