Website Blocker using python

Published on . Written by

This python project is very simple to understand & build and best for a developer for practising purposes. This kind of project will help the user to block certain distracting, unwanted websites from your PC like Gaming websites, Facebook, Instagram, Youtube, or any kind of website that bothers you, during your work hours or study hour, so that the user can not open them during the specific period. Rather than using other party applications to block certain websites, we can create our very own customized application which will block websites of our choice and developing a website blocker in python is not so difficult too as I mentioned earlier.

Read more..

SLNOTE
Project Description:


Skyfi Labs Projects
So, let begin with a description of the project what we doing in the project and programming language, etc.

  1. In this project, we will build a python based project, which will assist the user with blocking a specific site, like Instagram, Facebook, Youtube, etc. and so on for a specific time of the time like 9:00 to 10:00 hours. We are going to utilize the python worked in libraries, so no compelling reason to introduce some other bundles.
  1. Python-For programming reason, we are going to utilize Python as the Programming language. Python is easy to learn and work on with the language. It is an elevated level, broadly useful programming and exceptionally intruded on language.
  1. Some fundamental information on the host document since we are going to list sites which we need to block. Every operating system has a hosts file. The location of the host file may be different for the different operating systems. This host file is a map hostname to the IP address of the machine. Right now, we are going to list websites which we want to block.

SLLATEST
Project Implementation:

1. We know that every system/PC has a host file whether it is Mac, Windows or Linux and write commands to get a host file.

2. Now we should focus on Working of host file- Host is an operating system file that maps hostnames to IP addresses. We will outline/mapping hostnames of websites to our localhost address. Utilizing python file handling manipulation we need to compose the hostname in hosts.txt and evacuate all lines after your working hours. In this host file, we are going to list websites which we want to block.

3. Now do the coding part and write the script.

4. Now it's time to schedule the above script in Windows/Mac/ Linux.

5. Here I am going to tell scheduling the script in the window since it is somewhat dubious, let start -

  • Most importantly change the expansion of your script from ".py" to ".pyw".
  • Now open task scheduler and click on “Create Task” and fill the name of your decision and flag Run with the most elevated benefit.
  • Now go to triggers, select "At startup" to start the task.
  • Go to the Action bar and make another activity and give the way/path of your script.
  • Go to the conditions bar and unflag the power section.
  • Press ok and your script is scheduled.
  • Script scheduled is complete now.
6. Finally, restart your computer and see the result.

 Requirement -

-Programming language -  Python

-Operating System - any os like a window, Mac, Linux. 


SLDYK
Kit required to develop Website Blocker using python:
Technologies you will learn by working on Website Blocker using python:


Any Questions?


Subscribe for more project ideas