Hi all,
I am running below program :
http://palewi.re/posts/2008/04/26/python-recipe-connect-to-mysql-database-execute-a-query-print-the-results/on Centos 6.4 , Python 3.4 but not sure why it is failing with below exception :
root@db2 bin]# python printfields_new.py datbase1 tb_sime_darby
Wikified HTML for adunit.tb_sime_darby
========================
Traceback (most recent call last):
File "printfields_new.py", line 33, in <module>
PrintFields(users_database, users_table)
File "printfields_new.py", line 12, in PrintFields
mysql.execute(sql)
File "/usr/local/lib/python3.4/site-packages/pymysql/cursors.py", line 132, in execute
result = self._query(query)
File "/usr/local/lib/python3.4/site-packages/pymysql/cursors.py", line 271, in _query
conn.query(q)
File "/usr/local/lib/python3.4/site-packages/pymysql/connections.py", line 725, in query
self._execute_command(COM_QUERY, sql)
File "/usr/local/lib/python3.4/site-packages/pymysql/connections.py", line 888, in _execute_command
self._write_bytes(prelude + sql[:chunk_size-1])
TypeError: can't concat bytes to tuple
Anyone has any idea about this ? Also , how can we make sure to prevent from Identation erros in python ?
Thanks