有谁知道如何修复此错误:
File "lcd3.py", line 54
SyntaxError: Non-ASCII character '\xc4' in file lcd3.py on line 54, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
添加此行不会改变任何内容:
# -*- coding: utf-8 -*-
答案 0 :(得分:1)
尝试将这两者添加到代码的开头,然后在顶部取出您现有的内容:
#!/usr/bin/env python
# -*- coding: utf-8 -*-