Skip to content

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Simple Console Countdown Timer

A straightforward and easy-to-use console-based countdown timer written in Python. This utility allows you to set a duration in seconds, and it will count down, displaying the remaining time in a MM:SS format.

Features

  • Customizable Duration: Set the timer for any number of seconds.
  • Minute:Second Display: Shows the time in a clear MM:SS format.
  • Real-time Countdown: Updates every second.
  • User-Friendly Interface: Simple input prompt and "Time's up!" message.
  • Error Handling: Catches invalid input (non-numbers or non-positive numbers).

How it Works

The script uses Python's time module to pause execution for one second at a time, creating the countdown effect. It calculates minutes and seconds using the divmod() function for clean formatting.

Requirements

  • Python 3.x

How to Run the Application

  1. Save the Code:
    • Copy the entire Python code for the timer into a file named countdown_timer.py (or any other name ending with .py).
  2. Open Your Terminal/Command Prompt:
    • Navigate to the directory where you saved countdown_timer.py using the cd command.
      • Example (Windows): cd C:\Users\YourUser\Documents\my_scripts
      • Example (macOS/Linux): cd ~/Documents/my_scripts
  3. Run the Script:
    • Execute the Python script using the command:
      python countdown_timer.py

How to Use

  1. After running the script, you will be prompted to enter the duration:
    Enter the duration of the timer in seconds:
    
  2. Type a positive integer (e.g., 60 for one minute, 300 for five minutes) and press Enter.
  3. The timer will start counting down in the console:
    00:59
    00:58
    ...
    
  4. Once the time reaches zero, it will print "Time's up!".

Possible Enhancements

  • Sound Notification: Play a sound when the timer finishes.
  • Pause/Resume Functionality: Allow the user to pause and resume the countdown.
  • Multiple Timers: Support running multiple timers concurrently.
  • Background Operation: Run the timer in the background while the user does other tasks.
  • GUI: Create a graphical user interface instead of a console-based one using libraries like Tkinter, PyQt, or Kivy.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages