Python sqlite absolute path to database
package_dir = os.path.abspath(os.path.dirname(__file__)) | |
db_dir = os.path.join(package_dir, 'nd_slack.db') | |
# NEED 4 /'s to specify absolute for sqlalchemy! | |
# ex: sqlite:////asdfaijegoij/aerga.db | |
# NEED 3 /'s for relative paths | |
# path has a / at the beginning so we have 3 here | |
SQLITE_DB = ''.join(['sqlite:///', db_dir]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Great, thanks