随笔分类 -  Python2.7

摘要:和list比较,dict有以下几个特点: 1查找和插入的速度极快,不会随着key的增加而增加; 2需要占用大量的内存,内存浪费多。 字符串a=“abc” a.replace(‘a’,’A’) 阅读全文
posted @ 2016-03-23 19:44 南湖鹄 阅读(378) 评论(0) 推荐(0)
摘要:http://www.runoob.com/python/python-strings.html ASCII Unicode UTF-8 格式化 %运算符就是用来格式化字符串的。 在字符串内部,%s表示用字符串替换,%d表示用整数替换,%f浮点数 阅读全文
posted @ 2016-02-17 16:32 南湖鹄 阅读(127) 评论(0) 推荐(0)
摘要:变量 常量 PI 阅读全文
posted @ 2016-02-17 10:00 南湖鹄 阅读(367) 评论(0) 推荐(0)
摘要:#整数 1,100,-8080,0 0xff00,0xa54b #浮点数 1.23,3.14 1.23e9,12,3e8,1.23e-5 #字符串 "xyz",'abc' #转义字符\: 'I\'m\"ok"' #转义字符 \n 换行 \t制表符 \\ :\ r’’默认不转义 '''...''' # 阅读全文
posted @ 2016-02-17 09:55 南湖鹄 阅读(119) 评论(0) 推荐(0)
摘要:语法注释 输入输出 #语法缩进,4个空格 #注释 #冒号:结尾,缩进的预计视为代码块 #大小写敏感 #输出 print 300 print 'hello','world' #输入 a=raw_input() name=raw_input() print 'hello',name name=raw_i 阅读全文
posted @ 2016-02-17 09:38 南湖鹄 阅读(128) 评论(0) 推荐(0)
摘要:20160214 >20160824 一口气爬过高山 Happy Valentine’s Day https://docs.python.org/2.7/library/index.html 新闻: 201602-1引力波 http://www.techug.com/gwpy-ligo-analyz 阅读全文
posted @ 2016-02-14 12:36 南湖鹄 阅读(239) 评论(0) 推荐(0)
摘要:LyncLynn用途: 缩小图像 # -*- coding: UTF-8 -*- #Version: V1.0 #Author:lynclynn #CreateDate:20151201 #UpdateDate: #Description:Change the picture from PIL im 阅读全文
posted @ 2015-12-01 10:46 南湖鹄 阅读(537) 评论(0) 推荐(0)
摘要:批量修改文件格式,文件名后缀。 可能遇到的问题1.Error 32 .文件已经打开2.WindowsError: [Error 183] 文件已经存在3.Error2.文件路径问题 阅读全文
posted @ 2015-11-30 18:09 南湖鹄 阅读(888) 评论(0) 推荐(0)