默认pyhon使用ASCII码来解释程序的,默认不支持中文,需要在程序的第一行或者第二行声明编码。

官方解决方案:https://www.python.org/dev/peps/pep-0263/

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

最新文章

  1. 关于在aspx前台使用后台变量的问题
  2. jq pagination分页 全选、单选的思考
  3. Xcode 7.0升级后的bitcode
  4. debain 8为Iceweasel安装flash播放器
  5. 数据库中字段类型对应的C#中的数据类型
  6. linux学习笔记2-命令总结2
  7. 《C#开发微信门户及应用》
  8. .NET常用类库知识总结
  9. [GRYZ]寒假模拟赛
  10. C++ Primer 5th 第5章 语句
  11. hadoop(六) - ZooKeeper安装与配置
  12. 用php+mysql+ajax实现淘宝客服或阿里旺旺聊天功能 之 前台页面
  13. VUE实现请求数据
  14. 前端 CSS 介绍
  15. JavaScript函数箭头的优势在哪里
  16. 自定义alert弹框,title不显示域名
  17. 【教程】Source Insight 关联 .S文件,汇编文件
  18. mysql 内置功能 事务 介绍
  19. 【BZOJ 3812】 3812: 主旋律 (容斥原理**)
  20. PAT 1093 Count PAT&#39;s[比较]

热门文章

  1. Redis系列整理
  2. 浏览器文档播放Shockwave Flash 插件问题
  3. Android 开源控件系列_2
  4. js/jquery获取当前页面URL地址并判断URL字符串中是否包含某个具体值
  5. scrollTop,offset().top
  6. PBM文件格式
  7. 【Chromium中文文档】Chrome/Chromium沙箱 - 安全架构设计
  8. 快学Scala习题解答—第一章 基础
  9. gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources
  10. 探究android控件及布局