首页 > 其他 > 详细

Defining the Encoding

时间:2014-04-24 13:13:05      阅读:497      评论:0      收藏:0      [点我收藏+]

Defining the Encoding

    Python will default to ASCII as standard encoding if no other
    encoding hints are given.

    To define a source code encoding, a magic comment must
    be placed into the source files either as first or second
    line in the file, such as:

          # coding=<encoding name>

    or (using formats recognized by popular editors)

          #!/usr/bin/python
          # -*- coding: <encoding name> -*-

    or

          #!/usr/bin/python
          # vim: set fileencoding=<encoding name> :

注:支持中文
#coding:utf-8 这一行必须为py文件的首行


Defining the Encoding,布布扣,bubuko.com

Defining the Encoding

原文:http://blog.csdn.net/gaoxin12345679/article/details/24351711

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!