上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页
摘要: 相同功能,演进实现数据文件sarah2.txtsarah Sweeney,2002-6-17,2:58,2.58,2:39,2-25,2-55,2:54,2.18,2:55,2:551- 返回dictreturn({'Name':data_list.pop(0),'DOB':data_list.po... 阅读全文
posted @ 2014-06-19 14:52 galoishelley 阅读(546) 评论(0) 推荐(0)
摘要: 1- "原地"排序-转换后替换>>> list = [2,1,3]>>> list.sort()>>> list[1, 2, 3]降序 reverse = True>>> list.sort(reverse = True)>>> list[3, 2, 1, 1]2- "复制"排序-转换然后返回>>>... 阅读全文
posted @ 2014-06-18 15:54 galoishelley 阅读(275) 评论(0) 推荐(0)
摘要: 读取4个文件内容,格式化数据,升序,显示每个文件前3个数据julie.txt2.59,2.11,2:11,2:23,3-10,2-23,3:10,3.21,3-21james.txt2-34,3:21,2.34,2.45,3.01,2:01,2:01,3:10,2-22sarah.txt2:58,2... 阅读全文
posted @ 2014-06-18 15:33 galoishelley 阅读(628) 评论(0) 推荐(0)
摘要: 1- strip()方法可以从字符串去除不想要的空白符(role, line_spoken) = each_line.split(":", 1)line_spoken = line_spoken.strip()2- print() BIF的file参数控制将数据发送/保存到哪里print(...) ... 阅读全文
posted @ 2014-06-18 11:30 galoishelley 阅读(222) 评论(0) 推荐(0)
摘要: sketch.py 1 #--*-- coding:utf-8 --*-- 2 import pickle 3 import nester 4 man = [] 5 other = [] 6 try: 7 data = open ("datafile.txt") 8 9 for e... 阅读全文
posted @ 2014-06-18 11:07 galoishelley 阅读(328) 评论(0) 推荐(0)
摘要: datafile.txt #文件Man: this is the right room for an argument.Other Man: I've told you once.Man: No you haven'tOther Man: Yes, I have.(pause)Man: When?O... 阅读全文
posted @ 2014-06-17 16:54 galoishelley 阅读(408) 评论(0) 推荐(0)
摘要: datafile.txtMan: Is this the right room for an argument?Other Man: I've told you once.Man: No you haven'tOther Man:Yes I haveMan: When? and :(pause)Ot... 阅读全文
posted @ 2014-06-17 16:17 galoishelley 阅读(212) 评论(0) 推荐(0)
摘要: 1- range()1 >>> for each in range(2): print(each)2 3 ... 4 5 06 7 1 阅读全文
posted @ 2014-06-17 14:56 galoishelley 阅读(208) 评论(0) 推荐(0)
摘要: 以2.7升级到3.3为例1.删除原版本a)删除系统库中的版本sudo rm -R /System/Library/Frameworks/Python.framework/Versions/2.7b)删除Current版本sudo rm /System/Library/Frameworks/Pytho... 阅读全文
posted @ 2014-06-17 11:12 galoishelley 阅读(2024) 评论(0) 推荐(0)
摘要: 1- 多行注释 ''' ''' 或 """ """'''this is the standard way to include a multiple-line comment in you code'''"""this is the standard way to include a multipl... 阅读全文
posted @ 2014-06-16 16:48 galoishelley 阅读(304) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页