Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twisted.enterprise import adbapi
- dbpool = adbapi.ConnectionPool("MySQLdb", host="localhost",user="a",password="b",db="c")
- def getTime():
- return dbpool.runQuery("SELECT NOW() AS TIME")
- def printResult(result):
- if result:
- print("yes")
- else:
- print("no")
- getTime().addCallback(printResult)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement