|
操作系统:
[root@skyofus cgi-bin]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
python版本及输出中文乱码实例:
Python 3.5.3 (default, Mar 5 2017, 14:22:21)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print('舒服舒服')
File "<stdin>", line 0
^
SyntaxError: 'ascii' codec can't decode byte 0xe8 in position 7: ordinal not in range(128)
>>> import sys
>>> sys.stdout.encoding
'ANSI_X3.4-1968'
---------------------------------------------------------------分割线-----------------------------------
Python 2.7.5 (default, Sep 15 2016, 22:37:39)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print('水电费')
File "<stdin>", line 1
print(ਦ°´电费')
^
SyntaxError: invalid syntax
>>> print('水电费 ')
水电费
>>> sys.stdout.encoding
'ANSI_X3.4-1968'
|
|