python---打印输出/中文输出
2015-10-21 14:47
597 查看
print ('abc') print ("%s"%"abc") print 25 print ("%d"%25) print 1.83 print ("%.2f"%1.83) print ("his name is %s" %("xiaoming")) print ("his age is %d"%25) print ("his height is %.2f" %1.83) print ("his name is %s,his age is %d,his height is %.2f" %("xiaoming",25,1.83))
中文输出:脚本开头加 # -*- coding: utf-8 -*-用文本编辑器 打开脚本文件,将脚本文件的编码 设置成 ANSI,保存脚本
# -*- coding:utf-8 -*- print 'hello world,小花花'
<img src="http://img.blog.csdn.net/20151116170657583?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
相关文章推荐
- 【Python】调用WPS V9 API,实现Word转PDF
- Python正则表达式匹配操作re模块
- Python正则表达式匹配操作re模块
- Python-- easy_install 的安装
- [Python]Pip的安装以及简单的使用
- python----小数点精度控制round()
- python JSON性能测试与simplejson对比
- python 模块安装
- Python爬虫:动态网页抓取淘宝“淘女郎”照片
- what yield does in python?
- Python面向对象详解
- Python notes
- Python 正则表达式(分组)
- 关于python的执行顺序和@操作符
- Python 正则表达式(常用函数)
- Python 正则表达式(基础)
- python之时间处理模块 -- time
- Build a Python IDE for Windows with Notepad++ and IPython
- python GUI 实例
- Python学习笔记2