TianyiMoe/backend/randpic/random_picture.py

7 lines
160 B
Python

import json
import random
def get_random_picture():
with open("./jsons/pics.json") as f:
pictures = json.load(f)
return random.choice(pictures)