|
@@ -1,6 +1,6 @@
|
|
|
+import sys
|
|
|
import matplotlib.pyplot as plt
|
|
|
import json
|
|
|
-from matplotlib.animation import FuncAnimation
|
|
|
import threading
|
|
|
|
|
|
def read_data():
|
|
@@ -16,7 +16,8 @@ plt.ion()
|
|
|
plt.figure()
|
|
|
|
|
|
old_time, d = read_data()
|
|
|
-l = raw_input()
|
|
|
+plt.pause(0.01)
|
|
|
+l = sys.stdin.readline()
|
|
|
time, _ = l.split(" ", 1)
|
|
|
time = float(time)
|
|
|
|
|
@@ -38,13 +39,12 @@ while 1:
|
|
|
l = first
|
|
|
first = None
|
|
|
else:
|
|
|
- l = raw_input()
|
|
|
+ l = sys.stdin.readline()
|
|
|
|
|
|
if l == "CLOSE":
|
|
|
import sys
|
|
|
sys.exit(0)
|
|
|
elif l == "ALGEBRAIC_LOOP":
|
|
|
- print("Algebraic loop discovered...")
|
|
|
continue
|
|
|
time, key, value = l.split(" ")
|
|
|
time = float(time)
|
|
@@ -63,5 +63,5 @@ while 1:
|
|
|
maps[key].set_xdata(d[key][0])
|
|
|
maps[key].set_ydata(d[key][1])
|
|
|
plt.gca().set_xlim([min(d[key][0]), max(d[key][0])])
|
|
|
- plt.draw()
|
|
|
+ plt.pause(0.01)
|
|
|
write_data((0.0, d))
|