Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import streamlit.components.v1 as components
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Read HTML, CSS, and JS files
|
| 5 |
html_content = read_file('index.html')
|
| 6 |
css_content = '<style>' + read_file('style.css') + '</style>'
|
|
@@ -10,6 +14,5 @@ js_content = '<script>' + read_file('script.js') + '</script>'
|
|
| 10 |
complete_html = html_content.replace('<link rel="stylesheet" href="style.css">', css_content)
|
| 11 |
complete_html = complete_html.replace('<script src="script.js"></script>', js_content)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import streamlit.components.v1 as components
|
| 3 |
|
| 4 |
+
def read_file(file_path):
|
| 5 |
+
with open(file_path, 'r') as file:
|
| 6 |
+
return file.read()
|
| 7 |
+
|
| 8 |
# Read HTML, CSS, and JS files
|
| 9 |
html_content = read_file('index.html')
|
| 10 |
css_content = '<style>' + read_file('style.css') + '</style>'
|
|
|
|
| 14 |
complete_html = html_content.replace('<link rel="stylesheet" href="style.css">', css_content)
|
| 15 |
complete_html = complete_html.replace('<script src="script.js"></script>', js_content)
|
| 16 |
|
| 17 |
+
# Render the combined content in Streamlit
|
| 18 |
+
components.html(complete_html, height=600)
|
|
|