mysql - Getting server time and using it in python -


i have unique situation in need of pulling current time sql server , using value in python program string. don't know how pull down print or assign variable.

example:

do stuff... var = mysql server datetime <---- how do part ?? print var; more stuff...

you can use library _mysql connect server should work.

import _mysql  db = _mysql.connect(host="localhost",user="user", passwd="pass", db="db") db.execute('select now()') r = db.store_result()  time_var = r[0][0]  print time_var 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -