python中处理中文
2015-10-18 13:40
399 查看
在python中进行输入输出中文或者添加中文注释,需要在伴释的后面添加中文编码的代码:
#!/usr/bin/python # -*- coding: UTF-8 -*- class c: name="zhangsan"; age =11; def sayHello(self): print self.age; print self.name; myHello = c(); myHello.sayHello();
相关文章推荐
- 【Python】 2种实现文件复制的方法
- python str.split和numpy.split函数
- 【Python】三种遍历文件目录的方法
- Python 基础
- python中threading的常用方法的详解
- python第一次练习题
- python中汉字匹配
- Python beautifulsoup的安装与使用
- 【Python】Learn Python the hard way, ex47 自动化测试,环境变量设置
- python 函数 enumerate
- 初学python案例 字典
- Python IDLE 代码高亮主题
- 用R&Python在云端运行可扩展数据科学
- python实现简单爬虫功能
- python_12(查找字符串、字符串查找、时间转换、正则、限定符、分组)
- python_11(format、转义字符、连接字符、字符串操作函数、字符串反转)
- python初级教程:入门详解
- Python学习
- Python 配置日志
- 在arcgis使用python脚本进行字段计算时是如何解决中文问题的