以上是书上的代码。可是无法实现。len(list(reader)) =0 查询官网知道。reader=csv.reader(fh) Return a reader object which will iterate over lines in the given csvfile. csvfile c ...
分类:
编程语言 时间:
2017-08-31 09:49:27
阅读次数:
236
题目描述 Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the c ...
分类:
其他好文 时间:
2017-08-30 19:57:33
阅读次数:
154
1 # -*- coding:utf-8 -*- 2 import os 3 import re 4 p1=r"([0-9][0-9][AB])\.\w{3}$" 5 6 p2=r"^.+\,(\d{4}).+" 7 8 pattern1=re.compile(p1) 9 pattern2=re.c... ...
分类:
编程语言 时间:
2017-08-30 18:33:26
阅读次数:
329
先上代码。刚刚军训完回来,在军训期间想写一个项目,所以就写了个域名解析主要用了socket里的gethostbyname来解析urllist.txt里的域名 然后解析完成后在写入到iplist.txt中 >>>运行>>>>>> ...
分类:
编程语言 时间:
2017-08-30 11:08:47
阅读次数:
136
公司项目搜索部分用的elasticsearch,那么这两个之间的数据同步就是一个问题。 网上找了几个包,但都有各自的缺点,最后决定还是自己写一个脚本,大致思路如下: 1.在死循环中不断的select指定的表 2.读取表中更新时间晚于某个时间点的所有行 (初始化时候为"1970-01-01 00:00 ...
分类:
数据库 时间:
2017-08-26 19:45:36
阅读次数:
238
http://acm.hdu.edu.cn/showproblem.php?pid=2119 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 30 ...
分类:
其他好文 时间:
2017-08-26 18:45:07
阅读次数:
181
Escape Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 10920 Accepted Submission(s): 2630 Problem ...
分类:
其他好文 时间:
2017-08-24 21:27:27
阅读次数:
168
Hello everybody, I have a datable which contain multiple lines gotten from database, in the header of the datable i have a checkbox <ice:dataTable row ...
分类:
其他好文 时间:
2017-08-23 20:05:58
阅读次数:
181
fp = open(''test2.txt','w') #打开你要写得文件test2.txt lines = open('test1.txt').readlines() #打开文件,读入每一行 for s in lines: fp.write( s.replace('love','hate').re ...
分类:
编程语言 时间:
2017-08-23 14:58:56
阅读次数:
178