my application uses SQLite database for it’s data storage. Idelly, this database should reside on some network drive, let’s name it Z: (Windows XP’s “Map network drive” feature).
Application is being developed under Linux, with database locally stored. Here is a part of one module:
import sqlite3 as lite
con = lite.connect("base.db")
What would be the correct way to access database on Z: drive? Something along the lines of:
import sqlite3 as lite
import os
path = 'Z:\'
con = lite.connect(path+"base.db")
You should use
os.path.jointo create your path, since it will use the correct path seperator. Also, you can useos.nameto check if you’re running on windows:Nonetheless, you probably want to make the file location configurable to make it easier to develop/debug/deploy your application.