add: style
This commit is contained in:
parent
2018c7e3a2
commit
9d297fca7f
@ -2,11 +2,14 @@
|
||||
|
||||
<head>
|
||||
<title>My Readings</title>
|
||||
<style>
|
||||
{{style}}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>My Readings</h1>
|
||||
<table id="table">
|
||||
{{}}
|
||||
{{books}}
|
||||
</table>
|
||||
</body>
|
7
main.py
7
main.py
@ -3,9 +3,10 @@ from Book import Book
|
||||
|
||||
# Opening JSON file
|
||||
f = open('constructor.json', encoding='utf-8')
|
||||
|
||||
data = json.load(f)
|
||||
|
||||
f.close()
|
||||
f = open("style.css")
|
||||
style = f.read()
|
||||
f.close()
|
||||
|
||||
books = data['books']
|
||||
@ -16,5 +17,5 @@ for book_data in books:
|
||||
html += book.to_html()
|
||||
|
||||
f = open("cast.html")
|
||||
print(f.read().replace("{{}}", html))
|
||||
print(f.read().replace("{{books}}", html).replace("{{style}}", style))
|
||||
f.close()
|
Loading…
Reference in New Issue
Block a user