-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdo.py
More file actions
32 lines (26 loc) · 725 Bytes
/
do.py
File metadata and controls
32 lines (26 loc) · 725 Bytes
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
31
32
import sys
import getopt
import time
import auto_ACmoton
try:
options,args = getopt.getopt(sys.argv[1:], 'hs:t:', ['help', 'start=', 'interval='])
except getopt.GetoptError:
sys.exit()
for option,value in options:
if option in ('-s', '--start'):
start_pid = int(value)
if option in ('-t', '--interval'):
interval = int(value)
a = auto_ACmoton.AutoACMoton()
pid = start_pid
while True:
print '==========solving problem %d==========' % pid
code = a.solve(pid)
if code != 0:
print "cant solve problem %d, ErrorCode: %d" % (pid, code)
pid = pid + 1
continue
pid = pid + 1
for i in range(interval):
a.sendheartbeat()
time.sleep(60)