I am trying to keep a somewhat organized directory structure as I plan to add more and more scripts. So lets say I have a structure like this:
/src/main.py
/src/db/<all my DB conn & table manipulation scripts>
/src/api/<all my scripts that call different APIs>
My main.py script will include certain classes from db & api folders as needed. I have the blank __init__.py files in each folder so they are included fine. But say I want to include a class from the db folder in a script in the api folder? Like I would need to back up one dir somehow? The api scripts fail when I have a line like this in them:
from db.Conn import QADB
I am on v2.6.
Update: I have tried a relative import, but get this?
from ..db.Conn import QADB
^ SyntaxError:
invalid syntax