問題:
SyntaxError: Non-UTF-8 code starting with '\xba' in file E:/placement/placement/Placement Test/clTest.py on line 6, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
運行結果:
原因:編碼格式不對
解決辦法:
把相應Python程序文件的編碼轉成UTF-8格式
1、在文件第一行添加# encoding:utf-8
運行結果:
2.在文件第一行添加# -*- coding: gbk -*-