forked from Ghost-LZW/OJChecker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsk.py
37 lines (26 loc) · 826 Bytes
/
jsk.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
31
32
33
34
35
36
from src.jisuanke import caculate, util
from src import checker
from getpass import getpass
import json
username = input("input JSK username: ") # "18580619816"
password = getpass("input JSK password: ")
cookie = util.login(username, password)
ID = input("contest ID: ") # 9342
user = util.get_user()
# print(user)
# jsk = open("jsk.json")
data = util.get_data(ID, cookie) # json.load(jsk)
data, problem_num = caculate.solve(data['data'], user)
# print(data)
result = checker.check(data, problem_num, './config/jisuanke.xlsx', True, "jsk")
# with open("./jsk.json", "w") as jsk:
# jsk.write(json.dumps(data))
cnt = 0
while True:
try:
result.save("jskResult" + str(cnt) + ".xlsx")
break
except Exception as e:
print('error ', str(e))
print('try again')
cnt += 1