I have a project folder called Projects
and inside that folder I have a file called my_functions.py
. Now I have a folder named myProjects
and inside there is another python file called test.py
So it is something like
-Projects-
my_functions.py
-myProjects-
test.py
Now I have some functions in the my functions
folder let me call them f1
, f2
etc.
Now, I need to take a function from my_function.py
and use it inside the test.py
I have used things like
from my_functions import f1
from .my_functions import f1
from Projects.my_functions import f1
For the first one I get an error called
ModuleNotFoundError: No module named 'my_functions'
I have searched online and I find that I need to do something about _init_.py
somewhere (?) The problem is, I am new in codding so I could not find where to put that module, in what way etc. So if someone can tell me what to do step by step it would be really helpful.
Thanks
Here how it looks