The execution script name can be obtained with __file__
.
Combine this with the os.path module to access the file with a relative path from the execution script.
base = os.path.dirname(os.path.abspath(__file__))
name = os.path.normpath(os.path.join(base, '../local/local_db'))
Recommended Posts