Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import requests
|
| 2 |
|
| 3 |
st.set_page_config(page_title="")
|
|
@@ -12,11 +13,4 @@ fact = response.json()["text"]
|
|
| 12 |
col1, col2, col3 = st.columns([1, 10, 1])
|
| 13 |
with col2:
|
| 14 |
st.write(f"<h1 style='text-align: center;'>Fact generator</h1>", unsafe_allow_html=True)
|
| 15 |
-
st.write(f"<p style='text-align: center;'>{fact}</p>", unsafe_allow_html=True)
|
| 16 |
-
|
| 17 |
-
# Add a button to generate another fact
|
| 18 |
-
if st.button("Generate another fact"):
|
| 19 |
-
response = requests.get("https://uselessfacts.jsph.pl/random.json?language=en")
|
| 20 |
-
fact = response.json()["text"]
|
| 21 |
-
with col2:
|
| 22 |
-
st.write(f"<p style='text-align: center;'>{fact}</p>", unsafe_allow_html=True)
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
import requests
|
| 3 |
|
| 4 |
st.set_page_config(page_title="")
|
|
|
|
| 13 |
col1, col2, col3 = st.columns([1, 10, 1])
|
| 14 |
with col2:
|
| 15 |
st.write(f"<h1 style='text-align: center;'>Fact generator</h1>", unsafe_allow_html=True)
|
| 16 |
+
st.write(f"<p style='text-align: center;'>{fact}</p>", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|