问题:SyntaxError: Non-UTF-8 code starting with '\xb4' in file D:\java\eclipse-workspace\app\src\userLogin\login.py on line 4, but no encoding declared;

解决办法:

(1):修改:Windows——>Preferences——>workspace。(如下图所示)

 

Eclipse下执行Python文件出现SyntaxError: Non-UTF-8 code starting with '\xb4' in file

(2)修改Windows——>Preferences——>General——>Content types,点击右侧Text,选择下面Python,然后在Default encoding后面输入UTF-8, 选择Apply and Close.

 

Eclipse下执行Python文件出现SyntaxError: Non-UTF-8 code starting with '\xb4' in file

(3)先设置好前面两点,再将代码复制到Eclipse环境下。否则删除乱码,重新输入,再重新运行即可。

相关文章:

  • 2022-03-04
  • 2022-12-23
  • 2022-01-28
  • 2022-02-20
  • 2022-01-01
  • 2021-05-09
  • 2021-09-11
  • 2022-01-28
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-09-15
相关资源
相似解决方案