以SqlLite为例:
-
当前目录:
from sqlalchemy import create_engine engine = create_engine('sqlite:///local_sql_lite.db')
-
上级目录:
from sqlalchemy import create_engine engine = create_engine('sqlite:///../../local_sql_lite.db')
-
下级目录:
from sqlalchemy import create_engine engine = create_engine('sqlite:///xxx/xxx/local_sql_lite.db')
-
绝对路径:
from sqlalchemy import create_engine engine = create_engine('sqlite:Users/xxxx/Desktop/...../dbs/convertible_bond.db') # windows: # create_engine('sqlite:///C:\\Users\\Username\\AppData\\Roaming\\Appname\\convertible_bond.db')