Pyscripter为什么总报错?UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:安装了python2.6.6 /2.7pyscripter2.1.1.0代码:def main():passif __name__ == '__main__':main()运行报错UnicodeEncodeError:'ascii' codec can't e

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 18:57:52
Pyscripter为什么总报错?UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:安装了python2.6.6 /2.7pyscripter2.1.1.0代码:def main():passif __name__ == '__main__':main()运行报错UnicodeEncodeError:'ascii' codec can't e
xSMO@++!F( ĭ^*f-ƀl* !|  DiJMҦ7gvο؛TRʖ5Mܜ}UK7͢uSj\ ?#j,hs$Za"Vu=TL"8RUd# ӰuG7>c0βAdiJBȼ^LPұm`Ll"RW4EA33((APQ"1gy6 ~x՝?}6B{qx Lh:BZ N b8AdI^ |oO>WwT+ iA݊9-hZ+̤,=GQE:Tx7$qo^-Oljmh;{:觲J7\!HG%i^Iy:*#z* pywVh/@Wf=\m5Y撺^_ ٴCLW9﷔k*[اwZg}^5 4Lћ:%h֜,+VK# }ք>@s'4^5MrPP1xKliՄlǂbhPՖk{UAEQ~޾^Al b 47{9J@&B4bR Y

Pyscripter为什么总报错?UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:安装了python2.6.6 /2.7pyscripter2.1.1.0代码:def main():passif __name__ == '__main__':main()运行报错UnicodeEncodeError:'ascii' codec can't e
Pyscripter为什么总报错?UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:
安装了python2.6.6 /2.7
pyscripter2.1.1.0
代码:
def main():
pass
if __name__ == '__main__':
main()
运行报错
UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:ordinal not in range(128)
把python换成3.1.2 就没问题了.
可以运行.
因为想用py2.X 比较流行.所以还是想用py2.X ..
谁知道怎么解决上面的办法..
好像和 encode 什么的无关..
joy32812 按照你说的改完了的确没有上述问题了.把程序移动到其他电脑上不会出错吧.

Pyscripter为什么总报错?UnicodeEncodeError:'ascii' codec can't encode characters in position 1-2:安装了python2.6.6 /2.7pyscripter2.1.1.0代码:def main():passif __name__ == '__main__':main()运行报错UnicodeEncodeError:'ascii' codec can't e
在你python的安装目录下的Lib目录,找到site.py,修改def setencoding()方法
def setencoding():
.
.
if 0:
# Enable to support locale aware default string encodings.
把那个if 0该位if 1试试.
还有就是最好文件目录中不要出现中文.