diff options
Diffstat (limited to 'src/log_shit.py')
| -rw-r--r-- | src/log_shit.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/log_shit.py b/src/log_shit.py index ef2b633..a60711f 100644 --- a/src/log_shit.py +++ b/src/log_shit.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, time +import sys, time, subprocess try: log_file = sys.argv[1] @@ -18,4 +18,22 @@ except: print("file: %s\n\ how often: %f\n\ -how long: %f" % (log_file, how_often, time_to_do_it))
\ No newline at end of file +how long: %f" % (log_file, how_often, time_to_do_it)) + +start = time.time() +now = time.time + +print("we out here, yo", flush=True) +while (start + time_to_do_it) > now(): +# print("we out here, yo", flush=True) + + lat, lon, alt = [float(x) for x in subprocess.getoutput("src/dirty_hack").split(",")] + + print("%f: %f, %f, %f" % (time.time_ns() / (10**9), lat, lon, alt)) + f.write("%f: %f, %f, %f\n" % (time.time_ns() / (10**9), lat, lon, alt)) + + f.flush() + + time.sleep(how_often) + +f.close()
\ No newline at end of file |
