diff options
author | ache <ache@ache.one> | 2023-04-07 03:35:52 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2023-04-07 03:35:52 +0200 |
commit | 7666988f3cae377477a3e2f83e6218b2f80bbff0 (patch) | |
tree | 27cceb30e99f267ae828da04ca1123d08a0655c5 /autoMMS.py | |
parent | Remove trailing spaces (diff) |
[autoMMS]Improove strip
Diffstat (limited to 'autoMMS.py')
-rwxr-xr-x | autoMMS.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -17,13 +17,13 @@ if __name__ == "__main__": with open(sys.argv[1],'r') as f: for line in f: if "Text00 = " in line: - info = line[9:-1] # 9 = len('Text00 = ') ,strip the final '\n' + info = line.split(' = ')[1].strip() # 9 = len('Text00 = ') ,strip the final '\n' elif line.startswith('Text'): - info += line[9:-1] + info += line.split(' = ')[1].strip() if line.startswith('DateTime'): - date = line[9:-1] - time = time.strptime(date, '%Y%m%dT%H%M%S') - if info : + date = line.split(' = ')[1].strip() + timeInfo = time.strptime(date, '%Y%m%dT%H%M%S') + if info: a = info else: print("Error : MMS invalide format, no data info found") |