Python
码亮虔诚
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[Python]读写文件,处理log
#Filename: using_file.py poem = '''\ Programming is fun When the work is done if you wanna make your work also fun: use Python! ''' e = open('../poem.txt','w') e.write(poem) e.close()原创 2013-10-05 22:06:51 · 3127 阅读 · 0 评论 -
[Python]使用csv dialect 读写数据
# this is the input file of csv import csv name = str(raw_input('please input a name : ')) tele = int(raw_input('a phone No. : ')) age = int(raw_input('age : ')) class MYCSV(csv.excel): de原创 2013-10-05 21:28:29 · 4066 阅读 · 0 评论 -
[Python]用正则表达式进行word Count
# regular express to Count word import re import sys word_re = re.compile(r'\W') #line = 'How are you?' sum = 0 #f = open("test.txt") f = open(sys.argv[1]) for i in f.readlines(): word_c原创 2013-10-05 21:21:59 · 1814 阅读 · 0 评论
分享