pip3 install in_place
input cast goes in input.cast, this file is overwritten update the factor variable to increase the timelapse speed.
python3 script.py
| import in_place | |
| import json | |
| factor = 10 | |
| with in_place.InPlace('input.cast') as file: | |
| for line in file: | |
| linejs = json.loads(line) | |
| if isinstance(linejs, list) and type(linejs[0]) == float: | |
| linejs[0] = linejs[0]/factor | |
| file.write(json.dumps(linejs) + "\r\n") |