0% found this document useful (0 votes)
11 views9 pages

PWP Report Main

The document outlines a project for creating a website blocker using Python, emphasizing the need to improve productivity by limiting access to distracting websites. It details the methodology, including the algorithm and Python code used, as well as the advantages and disadvantages of such solutions. The project also discusses potential future enhancements and includes a weekly progress report on the project's development.

Uploaded by

xogix31164
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

PWP Report Main

The document outlines a project for creating a website blocker using Python, emphasizing the need to improve productivity by limiting access to distracting websites. It details the methodology, including the algorithm and Python code used, as well as the advantages and disadvantages of such solutions. The project also discusses potential future enhancements and includes a weekly progress report on the project's development.

Uploaded by

xogix31164
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Website Blocker using Python

Chapter - 1. INTRODUCTION TO THIS PROJECT

1.1. Abstract

The internet is full of information that can help you work more effectively. Unfortunately,
instant access to such an overwhelming amount of content can also backfire. What starts as a
quick jaunt to your social media feed or favorite website ends with dozens of open tabs and hours
of wasted productivity. We’ve all been there. Even with extraordinary discipline, it’s easy to fall
prey to these distractions. It’s far too easy to open your laptop, pull up a project you need to work
on, and then completely lose track of your responsibilities after seeing a notification from a
friend. Blocking websites has a positive impact on employee productivity. this is something that
has been proven time and time again. When businesses block websites to 'time-wasting'
websites, employees inevitably spend much less time browsing sites that are unrelated to their
jobs.

1.2. Rationale

Hardware or software web filtering solutions are essential for preventing users from
accessing websites with malicious content or inappropriate content such as malware infected
sites, and sites that may be distracting to employees or students. Blocking websites has a positive
impact on employee productivity. this is something that has been proven time and time again.
When businesses block websites to 'time-wasting' websites, employees inevitably spend much
less time browsing sites that are unrelated to their jobs.

1.3. Course Outcomes Addressed

a. Develop python program to demonstrate the use of operators


b. Perform operations on data structure in python
c. Develop functions for given problems
d. Design classes for given problems

Computer Department R. C. Patel Polytechnic 1


Website Blocker using Python

Chapter - 2. LITERATURE REVIEW

 Freedom for Mac or Windows –


Freedom blocks distracting websites and apps, but it does so much more than that. It’s an
all-in-one distraction blocker that allows you to block distracting websites, mobile apps, desktop
apps, or the entire internet. No matter what is distracting you and stealing away your time and
attention, Freedom gives you back control. Freedom is the only website, app, and internet
blocker that syncs blocks across all of your devices.

 StayFocused –
StayFocused is an extension available on the Google Chrome web browser. This makes
installation extremely straightforward – even if you aren’t tech-savvy. Many website blockers
have users enter a list of specific websites (often called a “blacklist”) to block for certain time
periods. The StayFocused approach is a bit different. Users enter the maximum amount of time
they would like to spend on specific websites before being blocked. So you can allow yourself
some time for idle browsing.

Computer Department R. C. Patel Polytechnic 2


Website Blocker using Python

Chapter - 3. PROJECT DETAILS

3.1. Actual Methodology Followed

 Algorithm:
STEP 1 –
Importing the required library.
STEP 2 –
Creating GUI windows.
STEP 3 –
Host paths and IP address.
STEP 4 –
Create Block Function.
STEP 5 –
Create Unblock Function.
STEP 6 –
Creating Labels and buttons.
STEP 7 –
Main commands.

 Python Code:
import datetime
import time

end_time = datetime.datetime(2024, 4, 7)
site_block = ["www.google.com"]
host_path = "C:/Windows/System32/drivers/etc/hosts"
redirect = "127.0.0.1"

while True:
if datetime.datetime.now() < end_time:
print("Start Blocking")

with open(host_path, "r+") as host_file:


content = host_file.read()

for website in site_block:


if website not in content:
host_file.write(redirect + " " + website + "\n")
else:
with open(host_path, "r+") as host_file:
content = host_file.readlines()
host_file.seek(0)
for lines in content:
if not any(website in lines for website in site_block):
host_file.write(lines)

host_file.truncate()
time.sleep(5)

Computer Department R. C. Patel Polytechnic 3


Website Blocker using Python

3.2. Actual Resources Required

No Name of resource Specification Quantity Remarks

1 Processor Intel i5 01

2 Operating system Windows 10 01

Lenovo ThinkPad
3 Computer system 01
L480

4 RAM 8GB 01

5 Software PyCharm IDE 01

Computer Department R. C. Patel Polytechnic 4


Website Blocker using Python

Chapter - 4. MICRO- PROJECT OUTPUTS

4.1. Output of the Micro- Project

Fig. Before Blocking

Fig. After Blocking

Computer Department R. C. Patel Polytechnic 5


Website Blocker using Python

4.2. Skills Developed / Learning Outcomes of this Project

A few of these cases can be when functioning with range() function, which results in an
offby-one error, failing to close a file, division by a negative number (resulting in an unwanted
number that rounds towards the negative part of the number line), etc. Therefore, it makes it
very important to have the skills of debugging. Python offers a robust shell of its own that allows
you to run commands in isolation and entirety. It is also known as REPL (read, evaluate, print,
and loop) which indicates it reads the command, evaluates it, prints the outcome, and awaits the
next command. This text-based command prompt, Shell lets you test code without explicitly
designing a file. Python has several exceptional benefits, and one of them is its extensive
collection of libraries. As per the Python Package Index, Python has more than 267,000 projects.
Well, this means there is a solid chance that whatever you’re trying to create, a package already
exists that can make the development easier for you. When programmers intend to design
something or are stuck in the middle of a project.

Computer Department R. C. Patel Polytechnic 6


Website Blocker using Python

Chapter - 5. ADVANTAGES, DISADVANTAGES & APPLICATIONS

5.1. Advantages
o The primary benefit of solutions for blocking web access is that they can prevent
Internet users visiting websites harboring malware or ransomware, websites that are
known to be fake.
o Blocking websites can help to make sure users are focusing on their jobs, and not their
social network.
o Blocking websites can also help conserve bandwidth for mission critical applications.

5.2. Disadvantages
o Sometimes, some of internet filters can block a wrong websites based on constant
rules.
o It needs Python environment for working.
o Some websites don’t work when the website blocker is active.

5.3. Applications

o It's an all-in-one distraction blocker that allows you to block distracting websites.
o No matter what is stealing away your time and attention, Freedom gives you back
control.

Computer Department R. C. Patel Polytechnic 7


Website Blocker using Python

Chapter - 6. CONCLUSIONS, FUTURE SCOPE & REFERENCES

6.1. Conclusion
We finally managed to complete our project of website blocker using Python. What we are
going to in this program is that we will pass the link of websites which you think is distracting
and the time that you are working on your computer and program will block those websites.

6.2. Future Scope

o We can add more features like auto blocking that will not require any user action that
can save time of our user.
o We can also add exceptional websites that do not need to be blocked.

6.3. REFERENCES

1. https://www.tutorialspoint.com/website-blocker-using-python
2. https://www.geeksforgeeks.org/website-blocker-using-python
3. https://techvidvan.com/tutorials/python-website-blocker

Computer Department R. C. Patel Polytechnic 8


Website Blocker using Python

WEEKLY REPORT/ PROGRESS RREPORT

Timing Sign of
Week Activity
Date the
no Duration performed
From To guide
in hours
1 09/01/2024 04:00pm 04:15pm 15 min Project Selection

2 14/01/2024 04:00pm 05:00pm 1 hour Introduction

3 16/01/2024 03:00pm 03:30pm 30 min Abstract

4 23/01/2024 04:00pm 05:00pm 1 hour Rationale

Course
5 11/02/2024 03:00pm 05:00pm 4 hours
Outcomes
Literature
6 20/02/2024 03:00pm 04:00pm 1 hour
Review
Actual
7 25/02/2024 03:00pm 05:00pm 2 hours
Methodology
Project
8 09/03/2024 03:00pm 05:00pm 4 hours
Outcomes
Advantages &
9 18/03/2024 03:00pm 05:00pm 2 hours
Disadvantages
Submission of
10 23/03/2024 03:00pm 05:00pm 4 hours
Report

Mr. D. T. Bharote
Name and Signature of the Project Guide

Computer Department R. C. Patel Polytechnic 9

You might also like