@
est 代码是这样的# -- coding: utf-8 --
import sys
import os
print(repr(open(__file__).read()))
a='大小写'
print(a)
# os.system("pause")
===========
然后报错
Traceback (most recent call last):
File "D:\
a.py", line 4, in <module>
print(repr(open(__file__).read()))
File "C:\Python30\lib\
io.py", line 1724, in read
decoder.decode(self.buffer.read(), final=True))
File "C:\Python30\lib\
io.py", line 1295, in decode
output = self.decoder.decode(input, final=final)
File "C:\Python30\lib\encodings\
cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 90: character maps to <undefined>
=====
去掉
a='大小写'
print(a)
正常
'# -- coding: utf-8 --\nimport sys\nimport os\nprint(repr(open(__file__).read()))\n\n# os.system("pause") \n'