error when using tkinter + sqlite3

I am trying to use sqlite3 in a gui (Tkinter) here, and when I try to compile the code using geany, its return this error

File "/home/armando/Documents/curso/python_projects/sqlite3.py", line 3
SyntaxError: Non-ASCII character '\xc3' in file /home/armando/Documents/curso/python_projects/sqlite3.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

How I can solve this?

Thanks

Light and peace!

Upvotes: 1

Views: 187

Answers (1)

jaime
jaime

Reputation: 2344

See pep 263 - http://legacy.python.org/dev/peps/pep-0263/

You have to declare your encoding at the top of your source module:

#!/usr/bin/python
# -*- coding: utf-8 -*-

Replace utf-8 with whatever encoding you've saved the file with.

Upvotes: 1

Related Questions