view raw
Tecnico Tecnico - 9 months ago 63
Python Question

Error using python and sqlite3

I have a directory (/home/usuario/Desktop/Example) with one database (MyBBDD.db) and the file ( that run the command "UPDATE".
If in the terminal I'm in the directory "Example", work fine but if Im not in the directory "Example" and I execute like this:

python /home/usuario/Desktop/Example/
" doesnt work fine, the error is: "no such table: name_table".
Somebody know what is the problem?
Thanks in advance.

Best regards.


When you create a connection object with sqlite3 in, use the absolute file path, i.e.

con = sqlite3.connect('/home/usuario/Desktop/Example/MyBBDD.db')