美文网首页
默认Python源文件编码

默认Python源文件编码

作者: AIOBird | 来源:发表于2017-06-05 15:45 被阅读0次

    Python2.x

    1. 默认编码为 ASCII

    2. 显式声明编码类型为‘UTF-8’

    # Add the below declaration to 1st line or 2nd line of source file
    #-*- coding: utf-8 -*-

    3. Defining Python Source Code Encodings

    Python3.x

    Using UTF-8 as the default source encoding

    相关文章

      网友评论

          本文标题:默认Python源文件编码

          本文链接:https://www.haomeiwen.com/subject/eegifxtx.html