Oct-05-2016, 06:28 PM
Hey,
I have PyMySQL working however the result its printing has an unexpected character.
{u'row1': 100, u'row2': 100}
All of the results i get have a u before each result. I could always just cut up the string but i was more so wondering what the u means.
Thanks
I have PyMySQL working however the result its printing has an unexpected character.
#!/usr/bin/python import pymysql.cursors connection = pymysql.connect( host='localhost', user='test', password='test', db='test', charset='utf8', cursorclass=pymysql.cursors.DictCursor ) try: with connection.cursor() as cursor: cursor.execute("SELECT * FROM `test` WHERE `id`=`1`") result = cursor.fetchone() print(result) finally: connection.close()These are the results i get.
{u'row1': 100, u'row2': 100}
All of the results i get have a u before each result. I could always just cut up the string but i was more so wondering what the u means.
Thanks