1.What I usually do is get an absolute path so the script\scripts always know where they are
dir = os.path.dirname(__file__)
abs_path = os.path.join(dir, DB_DOCS_NAME)
variable = open(abs_path)
2.If the main script is looking in the wrong place for other scripts then probably your imports are not correct.
Try to use this resource
Hope that I helped in some way
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.