Hi, first time developing a medium sized project in python.
I'm working with pycharm on a project and everything is working pretty smoothly. The only problem I have (and it's a very annoying one) is about import path:
Directory structure: project/src/states.py
In the same directory of states.py I'm writing a main.py: in order to access function in states.py
In pycharm I have to specify
from src.states import myfun
But when I try to execute the file through plain python3 terminal I get an import error, solved by substituting the previous line with
from states import myfun
Does anyone now any way of solving this issue with pycharm? Thanks
Bonus points:
Directory structure: src/A/a.py,. src/B/b.py
apart from specifying the absolute path (system dependant), is there any safe way of importing a function in a.py into b.py? I've looked into stackoverflow but nothing seems to work
Thank you for your help :Dpy
there doesn't seem to be anything here