从给定时间间隔的文本文件中获取数据的方法是什么。你知道吗
搜索.txt
19:00:00 , trakjkfsa,
19:00:00 , door,
19:00:00 , sweater,
19:00:00 , sweater,
19:00:00 , sweater,
19:00:00 , dis,
19:00:01 , not,
19:00:01 , nokia,
19:00:01 , collar,
19:00:01 , nokia,
19:00:01 , collar,
19:00:01 , gsm,
19:00:01 , sweater,
19:00:01 , sweater,
19:00:01 , gsm,
19:00:02 , gsm,
19:00:02 , show,
19:00:02 , wayfreyerv,
19:00:02 , door,
19:00:02 , collar,
19:00:02 , or,
19:00:02 , harman,
19:00:02 , women's,
19:00:02 , collar,
19:00:02 , sweater,
19:00:02 , head,
19:00:03 , womanw,
19:00:03 , com.shopclues.utils.k@42233ff0,
19:00:03 , samsu,
19:00:03 , adidas,
19:00:03 , collar,
19:00:04 , ambas,
我需要找出19:00:00到19:00:03之间的所有查询 有什么办法可以查出来吗?你知道吗
这将读取每行的前10个字节,其中包含逗号以下的每个字符。如果字符串
19:00:04
不在读取字符串中,我将带file.readline().strip()
的行的其余部分附加到queries
列表中。直到search_for
时间被读取为止。你知道吗使用内置的datetime module:
这将打印:
相关问题 更多 >
编程相关推荐