CoolFace
Apppublic

devaharikrishnan/countdown_timer

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
app.py33 linesDownload Raw Back to root
1# -*- coding: utf-8 -*-2"""countdown_timer.ipynb3 4Automatically generated by Colab.5 6Original file is located at7    https://colab.research.google.com/drive/1RNcRvibdshYK-j0y37dzffH821JV_6in8"""9 10import time11def set_countdown(seconds):12  yield "Your time starts now!"13  for i in range(seconds, 0, -1):14    yield f"{i:02d}"15    time.sleep(1)16    yield "your time is up!"17 18print("Welcome to the countdowntimer app!")19while True:20  choice = input("Do u want to use this app? hit(y/n):")21  if "y" in choice.lower():22   seconds = int (input("Enter a number: "))23   for msg in set_countdown(seconds):24    print(msg)25 26  elif "n" in choice.lower():27   print("ta-ta-bye=bye")28   break29else:30  print("Invalid input, please try again!")31 32import gradio as gr33gr.Interface(fn=set_countdown, inputs=gr.Number(label="enter a number"), outputs="text").launch()