2023-08-18 19:27:51 +02:00
|
|
|
import json
|
2023-08-27 14:12:28 +02:00
|
|
|
from shape import Shape
|
2023-08-18 19:27:51 +02:00
|
|
|
|
|
|
|
def json_to_python():
|
2023-08-21 18:54:05 +02:00
|
|
|
with open("shapes.json") as lines:
|
|
|
|
data = json.load(lines)
|
2023-08-28 08:00:52 +02:00
|
|
|
for i in data["shapes"]:
|
2023-08-21 18:54:05 +02:00
|
|
|
print()
|
2023-08-28 08:00:52 +02:00
|
|
|
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())
|