Mysql
 sql >> Datenbank >  >> RDS >> Mysql

pymysql-Verbindung select query and fetchall return tuple that has byte literals like b'25.00' but strings like '25.00'

b-Präfix bedeutet Byte-Literal in Python3. Versuchen Sie, es in einen String umzuwandeln.

...
res = (b'1', b'2015-01-02 23:11:19', b'25.00')
new_res = []
for i in res:
    new_res.append(i.decode(encoding='utf-8'))

new_res = tuple(new_res)
...