Foppe Hemminga 6 years ago
parent
commit
72cb21fafd
1 changed files with 5 additions and 5 deletions
  1. 5 5
      data.py

+ 5 - 5
data.py

@@ -40,14 +40,14 @@ cursor.execute(query)
 res = cursor.fetchone()
 res = cursor.fetchone()
 timestamp_latest = res.timestamp
 timestamp_latest = res.timestamp
 
 
-with open('timestamp.txt', 'r') as f:
+with open('timestamp.txt', 'r+') as f:
     timestamp_stored = f.read()
     timestamp_stored = f.read()
-    print(timestamp_stored)
+    #print(timestamp_stored)
     if timestamp_latest != timestamp_stored:
     if timestamp_latest != timestamp_stored:
-        print(timestamp_latest)
-        #f.write("{}".format(timestamp_latest))
+        # print(timestamp_latest)
+        f.write("{}".format(timestamp_latest))
     else:
     else:
-        print(timestamp_latest)
+        #print(timestamp_latest)
         # Exit when there is nothing to do
         # Exit when there is nothing to do
         sys.exit()
         sys.exit()