python3要用pymysql
conn=pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',db='test',charset='utf8')
cur=conn.cursor()
cur.execute("select * from article")
r=cur.fetchall()
cur.close()
conn.close()
print(r)
return render.article(r)
conn=pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',db='test',charset='utf8')
cur=conn.cursor()
cur.execute("select * from article")
r=cur.fetchall()
cur.close()
conn.close()
print(r)
return render.article(r)
python3安装web.py各种报错,如:ImportError: No module named ‘utils’
ModuleNotFoundError: No module named ‘db’等等。
解决方案如下:
pip install web.py==0.40.dev0
ModuleNotFoundError: No module named ‘db’等等。
解决方案如下:
pip install web.py==0.40.dev0
2018-02-13