Skip to content

Instantly share code, notes, and snippets.

@imakin
Created January 8, 2015 09:35
Show Gist options
  • Save imakin/9e0477ed6cd2b1b40a83 to your computer and use it in GitHub Desktop.
Save imakin/9e0477ed6cd2b1b40a83 to your computer and use it in GitHub Desktop.
ki
def DatabaseRunQuery(self,query):
self.initDatabase()
cursor = self.db.cursor()
try:
cursor.execute(query)
except Exception, e:
print repr(e)
self.statusbar.showMessage(repr(e),20000)
result = cursor.fetchall()
self.db.commit()
self.db.close()
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment