hnc-eduard/HNS/Excercises/13082023 ДЗ по фигурам JSON/main.py

18 lines
378 B
Python
Executable File

import json
from shape import Shape
def json_to_python():
with open("shapes.json") as lines:
data = json.load(lines)
for i in data["shapes"]:
print()
print("Type:", i["type"])
print("Color:", i["color"])
sh1 = Shape.create_shape(i)
print(sh1)
return "Программа завершена"
print(json_to_python())