摘要:pickle 列表解析 在实际开发中,适当地使用列表综合可以让代码更加简洁、易读,降低出错的可能。 list_1 = [1,2,3,5,8,13,22] list_2 = [] for i in list_1: if i % 2 ==0: print i list_2.append(i) print
阅读全文
摘要:正则表达式(1) 正则表达式(2) 正则表达式(3) 最后留一道习题: 从下面一段文本中,匹配出所有s开头,e结尾的单词。 从下面一段文本中,匹配出所有s开头,e结尾的单词。 site sea sue sweet see case sse ssee loses import re text = "s
阅读全文
摘要:查天气(1) http://wthrcdn.etouch.cn/weather_mini?citykey=101280804 http://wthrcdn.etouch.cn/WeatherApi?citykey=101280804 http://bbs.crossincode.com/forum.
阅读全文
摘要:操作list list切片 字符串的分割 字符串的索引和切片 读文件 写文件 两道课后作业: 两道课后作业: 1.从一个文件中读出内容,保存至另一个文件。 f = file('data.txt') data = f.read() print data f.close() #f1 = file('ta
阅读全文
摘要:Phthon安装 https://www.python.org/download/releases/2.7.5/ 安装结束还没完,我们还差最后一步:设置环境变量。这是什么东西我暂时先不解释,大家照着做就好。右键单击我的电脑(不,是你的电脑),依次点击"属性"->"高级"->"环境变量",在“系统变量
阅读全文