-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Pomodoro Timer * Update README.md * Update README.md
- Loading branch information
1 parent
215c7ce
commit db40916
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Pomodoro Timer for macOS/Linux | ||
import time | ||
import os | ||
|
||
def pomodoro_timer_unix(work_duration=25, break_duration=5, cycles=4): | ||
for cycle in range(cycles): | ||
print(f"Cycle {cycle + 1}/{cycles}: Start working for {work_duration} minutes.") | ||
time.sleep(work_duration * 60) | ||
os.system('echo -e "\a"') # Make a beep sound on macOS/Linux | ||
print("Time's up! Take a break.") | ||
|
||
print(f"Break time! Relax for {break_duration} minutes.") | ||
time.sleep(break_duration * 60) | ||
os.system('echo -e "\a"') # Make a beep sound on macOS/Linux | ||
print("Break is over! Back to work.") | ||
|
||
print("All cycles completed! Great job!") | ||
|
||
if __name__ == "__main__": | ||
work_duration = int(input("Enter work duration in minutes (default is 25): ") or 25) | ||
break_duration = int(input("Enter break duration in minutes (default is 5): ") or 5) | ||
cycles = int(input("Enter number of cycles (default is 4): ") or 4) | ||
|
||
pomodoro_timer_unix(work_duration, break_duration, cycles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Pomodoro Timer for Windows | ||
import time | ||
import winsound | ||
|
||
def pomodoro_timer_windows(work_duration=25, break_duration=5, cycles=4): | ||
for cycle in range(cycles): | ||
print(f"Cycle {cycle + 1}/{cycles}: Start working for {work_duration} minutes.") | ||
time.sleep(work_duration * 60) | ||
winsound.Beep(1000, 1000) # Sound an alert to indicate work period end | ||
print("Time's up! Take a break.") | ||
|
||
print(f"Break time! Relax for {break_duration} minutes.") | ||
time.sleep(break_duration * 60) | ||
winsound.Beep(1000, 1000) # Sound an alert to indicate break period end | ||
print("Break is over! Back to work.") | ||
|
||
print("All cycles completed! Great job!") | ||
|
||
if __name__ == "__main__": | ||
work_duration = int(input("Enter work duration in minutes (default is 25): ") or 25) | ||
break_duration = int(input("Enter break duration in minutes (default is 5): ") or 5) | ||
cycles = int(input("Enter number of cycles (default is 4): ") or 4) | ||
|
||
pomodoro_timer_windows(work_duration, break_duration, cycles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Pomodoro Timer | ||
## 📋 Overview | ||
The Pomodoro Timer is a productivity tool designed to help you manage your time efficiently using the Pomodoro Technique. It splits your work into intervals—typically 25 minutes of focused work followed by a 5-minute break. This cycle helps to boost focus and prevent burnout by encouraging regular breaks. The script is cross-platform, supporting both Windows and macOS/Linux. | ||
|
||
## ✨ Features | ||
- **Customizable Work and Break Durations:** Set your preferred time for work and break sessions. | ||
- **Support for Multiple Cycles:** Run multiple Pomodoro sessions in a row. | ||
- **Platform-Specific Alerts:** | ||
- **Windows:** Uses sound alerts (winsound) to notify users when a session is complete. | ||
- **macOS/Linux:** Uses terminal beep commands for notifications. | ||
|
||
## Running the script | ||
1. **Clone the Repository or Download the Script:** | ||
- clone the repository: | ||
``` | ||
git clone https://github.com/max-lopzzz/Python-Scripts/tree/master/Pomodoro%20Timer | ||
``` | ||
- Or download the script directly from the repository page. | ||
2. **Navigate to the Script Location:** Open your terminal (Command Prompt on Windows, Terminal on macOS/Linux) and navigate to the folder containing the script: | ||
``` | ||
cd path/to/your/script | ||
``` | ||
3. **Run the Script:** Execute the script using Python: | ||
``` | ||
python pomodoro_timer.py | ||
``` | ||
or, if `python` points to Python 2.x on your system: | ||
``` | ||
python3 pomodoro_timer.py | ||
``` | ||
### Customizing Durations | ||
- Once the script runs, it may prompt you to enter custom durations for both work and break intervals. | ||
- Simply follow the prompts to customize your session lengths. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters