【发布时间】:2022-10-06 01:36:13
【问题描述】:
DELIVERED,machine01,2022-01-20T12:57:06,033,Email [Test1] is delivered by [192.168.0.2]
以上是文本文件中的内容。我使用了 split(\",\") 方法,但我不知道如何使它如下工作。有人能帮忙吗?
\'DELIVERED\', \'machine01\', \'2022-01-20T12:57:06\', \'033\', \'Test1\', \'192.168.0.2\'
with open(\'log_file.log\', \'r\') as f:
for line in f.readlines():
sep = line.split(\",\")
print(sep)
标签: python-3.x