Skip to content

Commit b38c166

Browse files
committed
task 0015 added
1 parent db3766d commit b38c166

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

agmcs/0015/0015.py

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

agmcs/0015/city.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"1" : "�Ϻ�",
3+
"2" : "����",
4+
"3" : "�ɶ�"
5+
}

agmcs/0015/city.xls

5.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)