Chinaunix首页 | 论坛 | 博客
  • 博客访问: 55663
  • 博文数量: 11
  • 博客积分: 47
  • 博客等级: 民兵
  • 技术积分: 87
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-10 10:24
个人简介

不学无术

文章分类

全部博文(11)

文章存档

2015年(8)

2013年(1)

2012年(2)

我的朋友

发布时间:2015-03-16 16:26:42

>>> li = ['a', 'b', 'c']  >>> li.extend(['d', 'e', 'f'])   >>> li  ['a', 'b', 'c', 'd', 'e', 'f']  >>> len(li)   &nb.........【阅读全文】

阅读(885) | 评论(0) | 转发(0)

发布时间:2015-03-10 15:21:56

替换oldtxt,newtxtfor line in fileinput.input("filepath",inplace=1):    line=line.replace("oldtxt",“newtxt”)    print line例子2(f1 = file("hello.txt", "r")f2 = file("myhello.txt", "w")for s in f1.readlines():      f2.writes(s.replace("h.........【阅读全文】

阅读(8066) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册