Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,35 @@
|
|
1 |
import streamlit as st
|
2 |
import time
|
3 |
|
|
|
|
|
4 |
def main():
|
5 |
st.title("File Upload and Display")
|
6 |
|
7 |
-
|
|
|
|
|
8 |
uploaded_file = st.file_uploader("Upload a file")
|
9 |
|
|
|
|
|
10 |
if uploaded_file is not None:
|
11 |
-
#
|
12 |
-
file_contents = uploaded_file.read()
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
st.markdown(file_contents)
|
16 |
|
17 |
# Wait for 5 seconds
|
18 |
time.sleep(5)
|
19 |
|
|
|
|
|
20 |
# Show completed message
|
21 |
-
st.
|
|
|
|
|
22 |
|
23 |
if __name__ == "__main__":
|
24 |
main()
|
|
|
1 |
import streamlit as st
|
2 |
import time
|
3 |
|
4 |
+
|
5 |
+
|
6 |
def main():
|
7 |
st.title("File Upload and Display")
|
8 |
|
9 |
+
|
10 |
+
|
11 |
+
# File upload
|
12 |
uploaded_file = st.file_uploader("Upload a file")
|
13 |
|
14 |
+
|
15 |
+
|
16 |
if uploaded_file is not None:
|
17 |
+
# Display file contents using st.markdown()
|
18 |
+
file_contents = uploaded_file.read().decode("utf-8")
|
19 |
+
st.markdown("### File Contents:")
|
20 |
+
st.markdown(f"```{file_contents}```")
|
21 |
|
22 |
+
|
|
|
23 |
|
24 |
# Wait for 5 seconds
|
25 |
time.sleep(5)
|
26 |
|
27 |
+
|
28 |
+
|
29 |
# Show completed message
|
30 |
+
st.success("File processing completed!")
|
31 |
+
|
32 |
+
|
33 |
|
34 |
if __name__ == "__main__":
|
35 |
main()
|