0

In Canopy v2.1.1 ( Python 3.5.2) it seems I cant write in the DataBaseName.sqlite sitting in the same location as run-file?!

I am testing for file and file is FOUND fine:

> if (os.path.isfile(db_loc_1)): 

But cant execute Query

> db.execute (sql_query_str)

I get

sqlite3.OperationalError: no such table

Thanks. -PL

Polta Lashka
  • 105
  • 1
  • 12

1 Answers1

0

in a way this thread answered my issue...

Yes, and the code described there is good practice for a working program.

However if you are just playing around at the command line, an easier solution is to change the working directory to match where you are running the script. This is done from the drop-down menu at the upper right of Canopy's Python panel. See: http://docs.enthought.com/canopy/2.1/quick-start/code_editor.html#change-directory

Jonathan March
  • 5,800
  • 2
  • 14
  • 16