The UNO card game for card-simulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

10 lines
267 B

import os
# Open a file
path = r"cards/colored"
files = os.scandir(path)
for file in files:
card = file.name[:-4].upper()
color = card[0]
number = card[1:]
print(f'"{card}": {{ "image": "cards/colored/{file.name}", "color": "{color}", "number": "{number}" }},')