A simple alarm/reminder application with a graphical user interface (GUI). Set an alarm time using dropdown menus, and the application will alert you when the time arrives with both a visual popup and an audio alarm.
- Clean and modern GUI interface
- Easy-to-use dropdown menus for time selection (hours, minutes, seconds)
- Visual alarm notification with popup message
- Audio alarm (platform-specific beeps)
- Non-blocking alarm using threading
- Status indicator showing alarm state
- Cross-platform support (Windows, macOS, Linux)
- Language: Python
- Libraries:
tkinter(standard library - GUI)datetime(standard library)time(standard library)threading(standard library)winsound(standard library - Windows only)tk==0.1.0(wrapper package)
- Complexity: Beginner
# Install dependencies
pip install -r requirements.txt
# Run the program
python main.py-
Run the application:
python main.py
-
Select alarm time:
- Choose hour (00-23)
- Choose minute (00-59)
- Choose second (00-59)
-
Click "Set Alarm" button
-
Wait for the alarm to trigger at the specified time
-
When the alarm goes off:
- A popup message will appear
- An audio alert will play (platform-specific)
- Window: 400x250 pixels with modern dark theme
- Title: "⏰ Alarm Clock" with red styling
- Time Selection: Three dropdown menus (hours, minutes, seconds)
- Set Alarm Button: Green button to activate alarm
- Status Label: Shows current alarm status
- Uses
threading.Threadto run alarm check in background - Prevents UI from freezing while waiting for alarm
- Daemon thread automatically stops when main program exits
- User selects alarm time using dropdown widgets
- Click "Set Alarm" button to start alarm thread
- Thread continuously checks current time vs alarm time every 1 second
- When times match:
- Display popup message
- Play audio alert
- Reset alarm state
- Windows: Uses
winsound.Beep()for system beeps - macOS: Plays system alarm sound
- Linux: Uses paplay for audio playback
__init__(root): Initialize GUI and variablescreate_widgets(): Build all GUI componentsstart_alarm_thread(): Start alarm in separate threadalarm(): Main loop that checks time every secondtrigger_alarm(): Execute when alarm time is reachedplay_alarm_sound(): Platform-specific audio playback
┌─────────────────────────────────┐
│ ⏰ Alarm Clock │
│ │
│ Set Alarm Time │
│ │
│ [HH] : [MM] : [SS] │
│ │
│ [ Set Alarm ] │
│ │
│ Status: No alarm set │
└─────────────────────────────────┘
- Full support with
winsoundmodule - System beep sounds for alarm
- Uses system alarm sound
- Requires
/System/Library/Sounds/Alarm.aiff
- Uses freedesktop sound theme
- Requires
paplayaudio player
- Prevents multiple alarms from running simultaneously
- Graceful handling of missing audio files
- Thread-safe alarm state management
- Disabled button while alarm is active
# In create_widgets()
self.root.config(bg="#your_color") # Background
title_label.config(fg="#your_color") # Text colorself.root.geometry("width x height")Replace the play_alarm_sound() function to use your own audio file:
import pygame
pygame.mixer.init()
pygame.mixer.music.load("your_sound.wav")
pygame.mixer.music.play()- Tkinter GUI development
- Threading for non-blocking operations
- Date/time manipulation
- Event-driven programming
- Platform-specific code handling
- StringVar and OptionMenu widgets
- Multiple alarms support
- Recurring alarms (daily, weekly)
- Custom alarm sounds
- Snooze functionality
- Alarm history
- Dark/light theme toggle
- System tray integration
- Alarm labels/descriptions
- Alarm only triggers if application is running
- Audio playback depends on system configuration
- Time must match exactly (second precision)
- No alarm persistence (resets on app close)
This project is open source and available for educational purposes.