Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import random
|
3 |
+
|
4 |
+
def convert_alexandre_time(minutes):
|
5 |
+
multiplier = random.uniform(2.5, 4)
|
6 |
+
return int(minutes * multiplier)
|
7 |
+
|
8 |
+
st.set_page_config(page_title="Alexandre's Time Converter", page_icon="⏰")
|
9 |
+
|
10 |
+
st.title("🕰️ Alexandre's Time Converter 🕰️")
|
11 |
+
st.subheader("Convert Alexandre's optimistic estimates into reality!")
|
12 |
+
|
13 |
+
st.write("""
|
14 |
+
Ever wondered how long Alexandre *really* means when he says he'll be there in '5 minutes'?
|
15 |
+
Wonder no more! Use this handy converter to translate Alexandre's time estimates into more... shall we say... realistic expectations.
|
16 |
+
""")
|
17 |
+
|
18 |
+
alexandre_time = st.number_input("Enter Alexandre's estimated time (in minutes):", min_value=1, value=5, step=1)
|
19 |
+
|
20 |
+
if st.button("Convert Alexandre Time"):
|
21 |
+
real_time = convert_alexandre_time(alexandre_time)
|
22 |
+
|
23 |
+
st.success(f"Alexandre says: {alexandre_time} minutes")
|
24 |
+
st.error(f"Reality says: {real_time} minutes")
|
25 |
+
|
26 |
+
if real_time > 60:
|
27 |
+
hours = real_time // 60
|
28 |
+
minutes = real_time % 60
|
29 |
+
st.warning(f"That's {hours} hour{'s' if hours > 1 else ''} and {minutes} minute{'s' if minutes != 1 else ''}! Better grab a book or start a new hobby!")
|
30 |
+
|
31 |
+
excuse = random.choice([
|
32 |
+
"I got caught in a time vortex!",
|
33 |
+
"My watch must be running on Alexandre Standard Time.",
|
34 |
+
"I had to help an old lady cross the street... five times.",
|
35 |
+
"I was abducted by aliens who wanted to learn about punctuality.",
|
36 |
+
"I found a shortcut that turned out to be a longcut.",
|
37 |
+
])
|
38 |
+
|
39 |
+
st.info(f"Alexandre's excuse: '{excuse}'")
|
40 |
+
|
41 |
+
st.markdown("---")
|
42 |
+
st.write("Remember, time is relative... especially when it comes to Alexandre!")
|