我想知道是否有更多的pythonic方式来编写这个函数:
def parse(filename):
with open(filename, 'r', encoding='koi8-r') as f:
for log_line in f:
for s in services:
if ' ' + s + ' ' in log_line:
print(s)
services.remove(s)