Skip to content

Commit

Permalink
fix bugs in csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinkle23897 committed Feb 23, 2020
1 parent 9ed532a commit 158c68e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ pip3 install -r requirements.txt --user -U

- 卡在login:网络原因,看看pulse-secure关了没,重跑试试看
- `500 : Internal Server Error`:请拉取最新版的脚本。网络学堂自2020/2/22开启强制https。
- `info_xxx.csv`在Mac下打开是乱码:别用office,用mac自带的软件吧 :)
6 changes: 3 additions & 3 deletions learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def sync_info(c):
return

def append_hw_csv(fname, stu):
if not os.path.exists(fname):
f = ['学号', '姓名', '院系', '班级', '上交时间', '状态', '成绩', '批阅老师']
else:
try:
f = [i for i in csv.reader(open(fname)) if i]
except:
f = [['学号', '姓名', '院系', '班级', '上交时间', '状态', '成绩', '批阅老师']]
info_str = [stu['xh'], stu['xm'], stu['dwmc'], stu['bm'], stu['scsjStr'], stu['zt'], stu['cj'], stu['jsm']]
xhs = [i[0] for i in f]
if stu['xh'] in xhs:
Expand Down

0 comments on commit 158c68e

Please sign in to comment.