-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py.bak
32 lines (21 loc) · 825 Bytes
/
main.py.bak
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
import json
from random import choice
import shutil
save_number = []
j=1
while j<=1800:
random_id=choice([i for i in range(1,1801) if i not in save_number])
print("Serial: "+str(j), "Random: "+str(random_id))
shutil.copy("files/images/ ("+str(j)+").png", "outputfiles/images/"+str(random_id)+".png")
a_file = open("files/json/ ("+str(j)+").json", "r")
json_object = json.load(a_file)
print(json_object)
json_object["name"] = "Whanki #"+str(random_id)
json_object["file_url"] = "ipfs://NewUriToReplace/"+str(random_id)+".png"
json_object["custom_fields"]["edition"] = random_id
jsonFile = open("outputfiles/json/"+str(random_id)+".json", "w")
jsonFile.write(json.dumps(json_object))
print(json_object)
jsonFile.close()
save_number.append(random_id)
j=j+1