Defining Python Source Code Encodings

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Defining Python Source Code Encodings相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

翻译:《实用的Python编程》04_04_Defining_exceptions

Spring Boot @Autowired无法注入类 Consider defining a bean of type

Installing Python 3.5.2 from source

我的第一个python脚本

filebeat、logstash过滤器实例

JAXB - XML Schema Types, Defining Subtypes