时间:2021-07-01 10:21:17 帮助过:4人阅读
cursor.execute(sql2)
conn.commit()
row=cursor.fetchone()
for i in row:
print i
[root@zabbix_server ~]# python bb.py
192.168.X.X
XXX
XXX
[root@zabbix_server ~]# python aa.py
(u‘192.168.X.X1‘, u‘XXX‘, u‘XXX‘)
(u‘192.168.X.X2‘, u‘XXX‘, u‘XXX‘)
(u‘192.168.X.X3‘, u‘XXX‘, u‘XXX‘)
PYTHON-mysql fetchall和 fetchone之间的区别
标签: