forked from top-quarks/ARC-solution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmission.py
30 lines (27 loc) · 990 Bytes
/
submission.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from subprocess import *
from time import sleep, gmtime, ctime
from sys import *
def utctime():
t = gmtime()
return "%d-%02d-%02d %02d:%02d:%02d"%(t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)
pendings = []
while 1:
output = check_output(["kaggle c submissions"], shell=True).decode("utf-8")
for line in output.strip().split('\n')[3:]:
line = line.strip()
for i in range(10):
line = line.replace(' ',' ')
line = line.split(' ')
date, status = line[1], line[3]
if status == 'pending' and not date in pendings:
print()
print("Started ", date)
pendings.append(date)
if date in pendings and status != 'pending':
print()
print("Finished ", date, '-', utctime())
Popen(["zenity --info --text 'Kaggle submission done!'"], shell=True)
pendings.remove(date)
sleep(1)
print('.', end='')
stdout.flush()