Python
文章平均质量分 71
canlan818
这个作者很懒,什么都没留下…
展开
-
书写格式
Can we write x=100 instead of x = 100? You can, but it's bad form. You should add space around operators like this so that it's easier to read. How can I print without spaces between wor转载 2013-05-02 09:11:31 · 645 阅读 · 0 评论 -
notepad python
http://wenku.baidu.com/view/a980ef7e5acfa1c7aa00ccd5.html点击打开链接转载 2013-05-01 10:36:39 · 540 阅读 · 0 评论 -
基本字符——备份
EscapeWhat it does.\\Backslash ()\'Single quote (')\"Double quote (")\aASCII Bell (BEL)\bASCII Backspace (BS)\fASCII Formfeed (FF)\nASCII原创 2013-05-02 16:17:00 · 474 阅读 · 0 评论 -
Python print函数用法,print 格式化输出
Python输出函数用法 Python print函数用法,print 格式化输出使用print输出各型的 字符串整数浮点数出度及精度控制strHello = 'Hello Python' print strHello#输出结果:Hello Python#直接出字符串1.格式化输出整数python pri转载 2013-05-02 10:53:40 · 940 阅读 · 0 评论 -
Python基本语法1
2012-3-7#使用版本:Python 2.7.2当行注释 # 多行注释 ''' 或者 """ (三个单引号或者双引号)当行多断代码隔离 ; 下段代码的开始 : 代码的连接 print "too long"\ " words"\ 相当于 print too long words1. 类型转换 int(string) float(String)chr(ASCII值到字符) ord(ASCII字符转转载 2013-05-02 15:07:50 · 609 阅读 · 0 评论 -
python读写文件
1.open使用open打开文件后一定要记得调用文件对象的close()方法。比如可以用try/finally语句来确保最后能关闭文件。file_object = open('thefile.txt')try: all_the_text = file_object.read( )finally: file_object.close( )注:不能把open语句转载 2013-05-03 22:09:04 · 573 阅读 · 0 评论 -
Python unpack
from sys import argvscript, first, second, third = argvprint "The script is called:", scriptprint "Your first variable is:", firstprint "Your second variable is:", secondprint "Your third varia原创 2013-05-03 19:03:41 · 645 阅读 · 0 评论