I've been following the guide here for creating and importing your own custom modules, but I seem to be missing something.
So far, i have done:
- I have the directory C:\Users\Me\OneDrive\CustomModules\MathFunctions.
- Added C:\Users\Me\OneDrive\CustomModulesto my system environment PATH.
- Under MathFunctions, I have 2 files:__init__.pyandFunctions.py.
After starting Python, simply typing
from MathFunctions import Functions  # Doesn't work
as the guide shows doesn't work.
However, if I use the os.chdir() first, it works:
import os                                       # Works
os.chdir('C:/Users/Me/OneDrive/CustomModules')
from MathFunctions import Functions
Is there some way to avoid using os.chdir()? Or is that a necessary step every time?
