-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.py
More file actions
21 lines (16 loc) · 709 Bytes
/
Copy pathlayout.py
File metadata and controls
21 lines (16 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CSS_FILE = "../../../../css/darktheme.css"
CSS_STYLE = "../../../../css/style.css"
META_COMMAND = '<meta charset="utf-8" />'
LINK_COMMAND = f'<link rel="stylesheet" href="{CSS_FILE}" type="text/css" />'
STYLE_COMMAND = f'<link rel="stylesheet" href="{CSS_STYLE}" type="text/css" />'
def import_commands(file_path):
with open(file_path, "r") as file:
content = file.read()
final_content = "<!DOCTYPE html>\n"
final_content += "<html>\n<head>\n"
final_content += META_COMMAND + "\n" + LINK_COMMAND + "\n" + STYLE_COMMAND + "\n"
final_content += "</head>\n<body>\n"
final_content += content
final_content += "\n</body>\n</html>"
with open(file_path, "w") as file:
file.write(final_content)