Hello Everyone, welcome to Techienoobs in this blog we will get to know how to block a website using python. The methods which are shown now are just for educational purposes we are not responsible for any kind of misuse of the information in this blog.
Few people in work places like offices, colleges, internet cafes visit websites which they are not supposed to use. Many people block the websites by using the default browsers settings so that the intended persons do not use those websites which have been blocked. But do you know you can do the same with python with a simple code along with a GUI(Graphical User Interface). Yes, In this blog I am going to show you how to make your own website blocker with python along with the complete source code. Follow the below steps to make your own website blocker.
Note: This works only on windows
STEP 1: Open your command prompt.
STEP 2: Type the following command
pip install tk
STEP 3: After the packages are installed open idle
STEP 4: Copy the following code and paste it in your ide.
CODE:
STEP 5: Now open that saved file with administrator permissions Enter few domains of the websites and click on block button and the websites have been blocked.
Now that we have blocked the websites successfully let us now unblock the site which have been blocked .follow these steps to unblock the websites.
STEP 1: Open your Notepad with administrator permissions and navigate to C:\Windows\System32\drivers\etc\ Now open the hosts file in notepad.
STEP 2: There you will see your website names and remove them along with the ip address 127.0.0.1 and save it your websites will be unblocked.
here is the video of how to do it:
Comments
Post a Comment