修改默认代码到utf8:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@hz ~]# python Python 2.7.7 (default, Jun 28 2014, 18:11:47) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.getdefaultencoding() 'ascii' >>> ^C >>> reload(sys) <module 'sys' (built-in)> >>> sys.setdefaultencoding('utf8') >>> reload(sys) <module 'sys' (built-in)> >>> sys.getdefaultencoding() 'utf8' |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!