[ACCEPTED]-Why does my python not add current working directory to the path?-python-import

Accepted answer
Score: 78

It is the script's directory that is added, not 3 the current directory. If you turn inner_folder/ into 2 a package then you can use python -m inner_folder.myscript in order to 1 run the script while having app/ added to sys.path.

Score: 4

Whether or not the current directory is 2 in sys.path, import statements usually look like:

import mymodule

The 1 code you wrote looks like:

import 'mymodule.py'

More Related questions