MySQL returned datatype and python outputs different type for different functions -
I have a lot of problems with MySQL returns and it has been inserted into a QT table with Python. To use data = cursor.fetchall () : for i category (data): sqlTableWidget.setItem (index, i, QtGui.QTableWidgetItem (data [i]) index = index1 Basically I would have kept str () around the return, and it used to work for everything, except its That when I am abroad Unicode problems on language and date time so now I did not insert str () and foreign language on the table. However, now there are some problems with some strings 1) I do not include that time When I type type (data [i]) , it returns datetime and when I call it the data [i] = data [i] .strftime ( "% Y-% m-% d% H:% M:% S") It tells me 'Tupal' does not support object item assignment 2) Then I Just passed for that time. Now I try to get the integer to display. If data [i] == 1: print data [i] print type (data [i]) data [i] = str (data [i]) / Pre> This results in the following: gt; 1 ...