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

18 lines
378 B
Python
Raw Normal View History

2023-08-18 19:27:51 +02:00
import json
from shape import Shape
2023-08-18 19:27:51 +02:00
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 "Программа завершена"
2023-08-18 19:27:51 +02:00
print(json_to_python())