码迷,mamicode.com
首页 > 编程语言 > 详细

Defining Python Source Code Encodings

时间:2017-01-19 13:59:33      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:pre   efault   bin   odi   name   logs   bsp   int   using   

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> -*-

 

#-*— coding:utf-8 -*-

  

Defining Python Source Code Encodings

标签:pre   efault   bin   odi   name   logs   bsp   int   using   

原文地址:http://www.cnblogs.com/KennyRom/p/6306105.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!