使用tkinter+sqlite3时出错

2024-06-26 00:28:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在gui(Tkinter)中使用sqlite3,当我试图使用geany编译代码时,它返回以下错误

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

我怎么解决这个问题?在

谢谢

光明与和平!在


Tags: 代码pyhometkinter错误lineguisqlite3
1条回答
网友
1楼 · 发布于 2024-06-26 00:28:29

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

必须在源模块的顶部声明编码:

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

用保存文件时使用的任何编码替换utf-8。在

相关问题 更多 >