Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Python Alarm Clock

A simple command-line alarm clock built with Python.

I created this project while practicing Python and working with time handling, user input, audio playback, and keyboard input.

The program allows the user to set an alarm time and plays an alarm sound when the specified time is reached.

Features

  • Displays the current time
  • Allows the user to set an alarm
  • Continuously checks the current time
  • Plays an alarm sound when the alarm time is reached
  • Allows the alarm to be stopped using the keyboard

Technologies Used

  • Python 3
  • datetime
  • time
  • pygame
  • msvcrt

Requirements

Install pygame before running the program:

pip install pygame

How to Run

Clone the repository:

git clone https://github.com/ahmedraza-devs/python-alarm-clock.git

Open the project folder:

cd python-alarm-clock

Install the required library:

pip install pygame

Run the program:

python alarm_clock.py

When prompted, enter the alarm time in this format:

HH:MM:SS AM/PM

Example:

09:30:00 PM

Project Structure

python-alarm-clock/
│
├── alarm_clock.py
├── A Stroll - The Grey Room _ Density & Time.mp3
└── README.md

The MP3 file is used by the program as the alarm sound and is kept in the same directory as the Python script.

Learning Purpose

This project is part of my Python learning journey. It helped me practice working with modules, functions, loops, user input, date and time, audio playback, and basic program control.

Author

Ahmed Raza

GitHub: https://github.com/ahmedraza-devs

About

A simple command-line alarm clock built with Python.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages