Skip to content

Instantly share code, notes, and snippets.

@SDSkyKlouD
Created October 15, 2023 13:47
Show Gist options
  • Save SDSkyKlouD/dc01587ef245bef4c1a46088ba3066f0 to your computer and use it in GitHub Desktop.
Save SDSkyKlouD/dc01587ef245bef4c1a46088ba3066f0 to your computer and use it in GitHub Desktop.
import json
import random
dic = dict()
file = open("test.json", mode="w")
i = 0
while i < 5000000:
dic[i] = {
"int": 123456 + i + random.randrange(100000, 2 ** 30),
"double": (654321 - i + random.randrange(500, 2 ** 24)) / random.randrange(11, 99, step=2),
"boolean": bool(random.randint(0, 1))
}
i += 1
json.dump(dic, file)
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment