python运行脚本报错Non-UTF-8
写完脚本运行报:SyntaxError: Non-UTF-8 code starting with '\xa1' in file/createuser/test.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
解决办法:在脚本最上面也就是第一条写入
# coding=gbk 或者
#encoding = utf-8
然后再次运行

浙公网安备 33010602011771号