Skip to content

Commit db3766d

Browse files
committed
task 0014 added
1 parent 92d0916 commit db3766d

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

agmcs/0014/0014.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#coding:utf-8
2+
import json
3+
import xlwt
4+
5+
with open('student.txt','r')as f:
6+
data = f.read().decode('gbk')
7+
data = json.loads(data)
8+
9+
book =xlwt.Workbook(encoding = 'utf-8')
10+
sheet =book.add_sheet('student')
11+
12+
for i in range(len(data)):
13+
d = data[str(i+1)]
14+
sheet.write(i,0,i+1)
15+
for j in range(len(d)):
16+
sheet.write(i,j+1,d[j])
17+
book.save('student.xls')

agmcs/0014/student.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"1":["����",150,120,100],
3+
"2":["����",90,99,95],
4+
"3":["����",60,66,68]
5+
}

agmcs/0014/student.xls

5.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)