- WebSite Blocker is a Python's Code that works to block websites access in the browsers during a period of time. By default, the period is between 8:00 - 18:00.
- Python 3.7 version or later.
- Download the source code;
- Open cmd and go to Python Code's Folder;
- Tip:
python blocker.py
- Running: perhaps you needa run this code as Administrator (hosts files is changed only if the user is adm);
- Blocker Time: the websites are blocked between 8:00 - 18:00 and they are unblocked after this period when the code is running;
- Alert: if you block the websites and stop the code's execution, the websites will remain blockeds!!
- Manual Unblock: ito unblock the websites manually, you needa change the time period in the file and execute the code again!! Or you can just edit the file manually taking off the line with '127.0.0.1 web_site_url'
- You can check the blocker file in this path on your computer:
- Linux / Mac: /etc/hosts
- Windows: C:\Windows\System32\drivers\etc\hosts
- Toblock a website, you needa put the url with and without
www
, for example:
website_list = ['www.facebook.com', 'facebook.com']
Email: [email protected]
Linkedin: linkedin.com/in/csfelix/
Instagram: instagram.com/c0deplus/
Portfolio: CSFelix.io