A simple Python program to block some websites by redirecting in the hosts file. You may want to backup hosts file.
Add a new line with the link of website to block.txt
file.
You may want the program run in the background.
To do that, change the extension from py
to pyw
. It means the file name is changed to website_blocker.pyw
.
And also, you need to change the path in the program to your full path to run on task scheduler.
Then you can put it on task scheduler of Windows to run the program at start up time.