【发布时间】:2013-06-05 23:55:51
【问题描述】:
python 中的 SQLite,在屏幕上打印,python 3.2.4
我有这个代码
cur.execute("SELECT * FROM Player")
while True:
row = cur.fetchone()
print(row)
print("why {0}".format(cur.fetchone()))
if row == None:
break
我收到这个输出: 从数据库加载
(1, 'Damian', 1, 15, 18, 100, 100)
why None
None
why None
(((((1, 'Damian', 1, 15, 18, 100, 100)))
【问题讨论】:
-
row在第二个循环中是None,因此它没有第一个元素。
标签: python sqlite printing screen output