-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
43 lines (36 loc) · 1.21 KB
/
main.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
37
38
39
40
41
42
43
# 头歌爬虫主程序(educoder)
import get_cookie
import getData
import getCode
import filesCode
import time
if __name__=="__main__":
# 登录并获取cookie
get_cookie.get_cookie()
time.sleep(0.5)
# 输入姓名、班级、学号
print("\n以下信息用于生成实验报告")
name = input('请输入姓名:')
clas = input('请输入班级:')
id = input('请输入学号:')
# 选择生成作业或实验
while True:
choice = int(input('\n请选择要生成的内容\n1.生成作业练习\n2.生成实验项目\n在此输入序号选择: '))
if choice == 1:
choice = 0
print("\n正在生成作业练习...\n")
break
if choice == 2:
choice = 1
print("\n正在生成实验项目...\n")
break
else:
print("\n输入错误,请重新输入!\n")
# 获取所有json内容
score_jsons = getData.getData(choice)
# 删除cookie
get_cookie.remove_cookie()
# 生成报告PDF和源代码文件
getCode.getCode(score_jsons)
filesCode.output_pdf(score_jsons, name, clas, id)
print("\n生成完毕,请查看OUT文件夹!\n")