This is a script that aims to implement a website blocking utility for Windows-based systems. It makes use of the computer's hosts files and runs it as a background process, preventing access to the sites entered by the user in array format.
The project requires Python's datetime library only
Open Command Prompt on your computer and type the following:
On the script's console, type:
import time
from datetime import datetime as dt`
After opening the script in your Python IDE, execute the code so that you get the console output window. Open your browser and try to visit the websites you blocked. When the script runs successfully, you will see This site can't be reached
error on the browser.
Note:
In some systems, access to the computers's hosts files maybe denied by default to prevent malware attacks. So the script while executing may show an error while modifying the hosts files.
Please visit [here](https://www.technipages.com/windows-access-denied-when-modifying-hosts-or-lmhosts-file) for a brief readup on how to solve the issue.
The acess will be denied to all the mentioned sites as per you changes the list