python == 判断异常,,UnicodeWarning,求助
for row in csv.reader(open(r'testm.csv','rb'),delimiter=','):
sql=""
cursor = MySqlConn.cursor()
cursor.execute(sql)
dbRet=cursor.fetchone()
if not tuple(row)==dbRet:
#其他操作
在ubuntu下if判断出现异常信息:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal.
coding=utf8,请问各位大侠,应该怎么处理?
[解决办法]
py3
open(r'testm.csv','r', encoding='utf-8')
py2
不清楚