

I won’t go into much detail about how the python script is written but here’s the premise.
#Python active timer modules how to#
If you wonder how to add a website blocker to the timer, just look below.
#Python active timer modules windows#
BONUS: Adding a website blocker through Windows HOSTS file You can right-click on the shortcut file and select change icon, then voilà, we have a personalized Pomodoro timer. These are the extension names used for Microsoft. In order to change the icon image, you can browse.

Changing your icon to personalize the Pomodoro experience To run the file directly from your desktop, just right-click on the pythonw file and select create shortcut. Now you can double-click on the file, and your timer will open! This simple trick allows for your program to run from hidden command prompt, and prevents you from accidentally closing it. To run the app as a background process, change the python extension from pomodoro.py to pomodoro.pyw. Now that you have a working program, let’s put it all together.

This allows the computer to be more efficient and use only necessary resources, updating every 20 seconds. In order to save memory space and only refresh the loop every few seconds, the time.sleep(secs) method is used. These all come pre-installed with most python installations, so you only need to import them (below). Note: I am fairly new to python, so if you have any suggestions regarding my style and content please share them with me ) Creating the Python Appįor those who know their way around python, I will be using time, datetime, tkinter, and winsound modules for this program.
