2018年11月14日
摘要: ["eth0\tno\teth0\n","pan0\t\tno\eth1\t\n","\t\t\eth2"]压缩为["eth0\tno\teth0\n","pan0\t\tno\eth1\t\\t\t\eth2"] 在pop的时候同时计算索引和长度。 阅读全文
posted @ 2018-11-14 19:36 保质期两天 阅读(85) 评论(0) 推荐(0) 编辑
  2016年1月20日
摘要: Linux系统下安装rz/sz命令及使用说明 http://blog.csdn.net/kobejayandy/article/details/13291655 阅读全文
posted @ 2016-01-20 11:57 保质期两天 阅读(95) 评论(0) 推荐(0) 编辑
  2016年1月14日
摘要: 1.查看以及 阅读全文
posted @ 2016-01-14 18:19 保质期两天 阅读(106) 评论(0) 推荐(0) 编辑
  2016年1月5日
摘要: 1.根据字符串来导入模块。2.根据模块来使用函数。>>> module_name='sys'>>> mo=__import__(module_name)>>> mo>>> print mo.path['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat... 阅读全文
posted @ 2016-01-05 23:18 保质期两天 阅读(114) 评论(0) 推荐(0) 编辑
摘要: yielddef foo(max): n, a, b = 0, 0, 1 while n<max: yield b a, b = b, a+b n+=1for item in foo(5): print itemyield 的作用就是把一... 阅读全文
posted @ 2016-01-05 16:45 保质期两天 阅读(145) 评论(0) 推荐(0) 编辑
摘要: >>> range(10)[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> xrange(10)xrange(10)>>> type(range(10))>>> type(xrange(10))range()执行之后在内存中申请10个单位的内存空间。xrange()只有在迭代的时候... 阅读全文
posted @ 2016-01-05 16:28 保质期两天 阅读(684) 评论(0) 推荐(0) 编辑
  2016年1月2日
摘要: 1.创建新字典(根据语法和dict初始化方法)>>> my_dict={'a':1,'b':2,'c':3}>>> my_dict=dict({'a':1,'b':2,'c':3})>>> mydcit=dict(a=1,b=2,c=3)>>> mydict=dict([('a',1),('b'... 阅读全文
posted @ 2016-01-02 14:03 保质期两天 阅读(184) 评论(0) 推荐(0) 编辑
摘要: str.join(iterable)Return a string which isconcatenation the of the strings in theiterableiterable. The separator between elements is the string prov... 阅读全文
posted @ 2016-01-02 10:09 保质期两天 阅读(368) 评论(0) 推荐(0) 编辑
摘要: strig=“what is your name”substring="name"str.endswith(suffix[,start[,end]])str.find(sub[,start[,end]])str.index(sub[,start[,end]])str.rfind(sub[,start... 阅读全文
posted @ 2016-01-02 10:00 保质期两天 阅读(353) 评论(0) 推荐(0) 编辑
  2016年1月1日
摘要: r+与w+r+是读写模式,在文件的末尾进行追加操作。>>> myfile=open('pwd.txt',... 'r+')>>> myfile.read()'admin 123 1\nczz 121 0\nusr 123 0\n'>>> myfile.write('123')>>> myfile.r... 阅读全文
posted @ 2016-01-01 23:00 保质期两天 阅读(251) 评论(0) 推荐(0) 编辑