-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
52 lines (40 loc) · 1.18 KB
/
test.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
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:wjher
# import jsons
# import pandas as pd
# df = pd.read_csv('./hotlinks/link.csv')
# ansList = df['hotlink'].values.tolist()
# print(ansList)
# def load_json(filename):
# with open(filename, 'r', encoding='UTF-8') as json_file:
# data = json.load(json_file)
# return data
# def save_json(filename, savedata):
# outputFile = open(filename, "w", encoding='utf-8')
# json.dump(savedata, outputFile, ensure_ascii=False)
# outputFile.close()
# def addNode(parent, node):
# if node['pid'] == parent['mid'] or node['pid'] == '':
# node['pid'] = parent['mid']
# if 'children' not in parent.keys():
# parent['children'] = []
# parent['children'].append(node)
# return True
# else:
# for child in parent['children']:
# if addNode(child, node):
# return True
# return False
# datalist = load_json('./repost/6.json')
# root = datalist[0]
# for node in datalist[1:]:
# addNode(root, node)
# save_json('./tmp.json',root)
import random
a = []
a.insert(-1,0)
print(a)
print(len(a))
print(random.random())
print(random.randint(0,1))