rioanggara's picture
test
f2ba8f4
raw
history blame
873 Bytes
import gradio as gr
import time
def start_pomodoro(duration):
# This function will simulate a Pomodoro timer.
# Real asynchronous waiting or background tasks aren't feasible with Gradio in its current state,
# so we'll return a message instead of a real timer.
if duration == 25:
return "Pomodoro started! Work for 25 minutes."
elif duration == 5:
return "Short break started! Relax for 5 minutes."
else:
return "Long break started! Relax for 15 minutes."
iface = gr.Interface(
fn=start_pomodoro,
inputs=gr.Dropdown(choices=[25, 5, 15], label="Select Duration (minutes)"),
outputs="text",
title="Simple Pomodoro Timer",
description="Select duration and start a Pomodoro timer. Currently, the timer is simulated; it doesn't count down in real-time."
)
if __name__ == "__main__":
iface.launch()