-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathread_json.py
More file actions
39 lines (31 loc) · 890 Bytes
/
read_json.py
File metadata and controls
39 lines (31 loc) · 890 Bytes
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
# -*- coding: utf-8 -*-
# @Time : 2022/1/21 20:56
# @Author : beyoung
# @Email : linbeyoung@stu.pku.edu.cn
# @File : read_json.py
import datetime
import json
import os
import time
from datetime import timedelta
import pprint
def read_json(jsonPath):
jsonfile = open(jsonPath)
json_list = json.load(jsonfile)
# print(json_list[0])
# print(type(json_list))
return json_list
def show_json(jsonPath, show_none=0):
jsonfile = open(jsonPath)
json_list = json.load(jsonfile)
# json_list = json_list.sort()
# json_list = sorted(json_list)
# print(len(json_list))
print(len(json_list))
return
json_pth = '/Users/Beyoung/Desktop/Projects/comms/120/网易游戏雷火校园招聘_复制.json'
json_list = read_json(json_pth)[:30]
# print(len(json_list))
# json_list.sort()
# json_list = show_json(json_pth)
pprint.pprint(json_list)