16:02:04 djflajdflsdasjdfla2
16:03:09 djflassjdfla3
16:04:03 djflajdflsdasjdfla4
16:05:02 djflajdflasjdfla5
16:06:22 djflajdafla6
16:07:02 djflajsaaasasjdfla7
16:08:02 djflajdsasjdfla8
16:08:12 djflajdsasjdfla9
16:09:33 djflajdfslasjdfla10
16:11:06 djflajdfsdflasjdfla11
16:22:52 djflajdbbbasjdfla12
16:34:42 djflajdcccdfla13
17:05:07 djflajdflsssjdfla14
17:09:02 djflajdfyrrrdfla15
我要过虑出16:02到17点05这段内容,谁有好的方法么!
import fileinput
import time
def p(line):
return time.strptime(line.split()[0], "%H:%M:%S")
start, end = p("16:02:00"), p("17:05:00")
for line in fileinput.input():
if start <= p(line) < end:
print line