sqlalchemy初識
768 ワード
from sqlalchemy import *
db=create_engine('mysql://root:dh6svp****@localhost:3306/tnv2?charset=utf8',encoding = "utf-8",echo =True)
meta = MetaData(db)
tab = Table("User",meta,autoload=True)
s=tab.select()
r = s.execute()
row=r.fetchone()
print row