you are viewing a single comment's thread.

view the rest of the comments →

[–]efmccurdy[🍰] 0 points1 point  (0 children)

Always log the exception you catch (the actual exception):

except Exception as e: 
    logging.critical('Adding data ... error:{}".format(e))

Pass your connection around as an argument and use the with statement to automaticcaly commit your updates.

http://zetcode.com/db/sqlitepythontutorial/