例如我有这个文本(输入):
Event Time, Monday:
10:01:02,269 to 10:01:08,702
(Reported by John).
Event Time, Sunday:
20:01:08,931 to 20:01:15,234
(Reported by Peter).
...
然后你想改变并增加时间(仅时间),因此(输出):
Event Time, Monday:
10:01:02,369 to 10:01:09,002 #Change the microseconds and seconds
(Reported by John).
Event Time, Sunday:
20:01:09,131 to 20:01:15,934 #Change the microseconds and seconds
(Reported by Peter).
一旦我有时间,我就可以改变。所以问题是如何只获取时间。我在想也许一种方法是将时间收集在列表中,如下所示:
times = ['10:01:02,269', '10:01:08,702', '20:01:08,931', '20:01:15,234']
但如何做到这一点呢?那么,如何在列表中增加它呢?最后是如何在不更改文本的情况下打印。