findall function return all results instead the one specified in in IF clause in python
Here is my code
def ExtractTimeAndFrequency():
for line in ft.split('\r\n'):
if 'cpu7' in line:
tm = re.findall(r"([0-2][0-9]:[0-5][0-9]:[0-5][0-9])", ft)
fr= re.findall(r"\d{7}", line)
return fr, tm
Aucun commentaire:
Enregistrer un commentaire