MyReadings/main.py
2024-08-05 21:14:49 +02:00

20 lines
373 B
Python

import json
from Book import Book
# Opening JSON file
f = open('constructor.json')
data = json.load(f)
f.close()
books = data['books']
html = ""
for book_data in books:
book = Book(book_data["name"], book_data["description"], book_data["image"], book_data["review"])
html += book.to_html()
f = open("cast.html")
print(f.read().replace("{{}}", html))
f.close()