| author | ymh <ymh.work@gmail.com> |
| Fri, 23 Jan 2015 02:00:19 +0100 | |
| changeset 131 | 0bb70072a56f |
| parent 0 | e1d4d7a8255a |
| permissions | -rw-r--r-- |
import sys import csv import datetime import time import ntplib from txosc import osc if __name__ == '__main__': t0 = time.time() with open(sys.argv[1], 'rU') as datafile: reader = csv.reader(datafile, delimiter=' ') for row in reader: t1 = t0 + float(row[1])/10**3 timetag = ntplib.system_to_ntp_time(t1) print " ".join([str(s) for s in [timetag, int(row[1]), 0] + [int(s) for s in row[2:4]]])