Guest User

Untitled

a guest
Nov 21st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "dbevent.py", line 18, in <module>
  3. cursor.execute(data)
  4. [...]
  5. self.description = self._result and self._result.describe() or None
  6. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 1: invalid
  7. continuation byte
  8.  
  9. import MySQLdb
  10. db = MySQLdb.connect(host="",
  11. user="",
  12. passwd="",
  13. db="modelo_conexion")
  14. cursor = db.cursor()
  15.  
  16. query = "SELECT * FROM "
  17. table = "2017_maq_u02"
  18. data = query + table
  19. cursor.execute(data)
  20.  
  21. results = cursor.fetchone()
  22.  
  23. print(results)
  24. db.close()
Add Comment
Please, Sign In to add comment