Forum Archive

import path in subdirectories from interactive propmt

jose3f23

I am trying import a module in a subdirectory using the interactive prompt. Module is not found because it seems Pythonista does not set correctly the path to the current subdirectory.

omz

The interactive prompt interpreter is entirely independent from the script editor, so the current directory will always be the documents root, unless you change it with os.chdir().

jose3f23

I use:
sys.path.append('.') and it works.

Thanks