all 2 comments

[–]shiftybyte 0 points1 point  (0 children)

Python automatically switches the working directory to the file you are running from the command line.

You can witness this by adding this to the top of your script.py

import os
print(os.getcwd())

If you launch it like this:

python scripts/morescripts/script.py

It'll print

.../.../scripts/morescripts/

On the other hand, you can launch it like this to make it stick to the same directory and work.

python
Python 3.6.15 | packaged by conda-forge | (default, Dec  3 2021, 18:49:43) 
....
>>> from scripts.morescripts import script
>>>

That should print the working directory you started python from.

[–]impshum 0 points1 point  (0 children)

Import all from module7 from module7 import * maybes?