Inspiration

I think that especially when we are learning in online school, it's super easy to get distracted. For me, I don't have the willpower to stay focused, so blocking distracting websites is a must if I want to learn anything.

What it does

Basically, this program edits the Window 10 host file. The host file allows you to redirect certain webpages to a specified IP. I used this functionality to create a list of websites and block them with my code.

How I built it

I had to teach myself how to edit files in python, and after learning the read and write functions, I wrote a loop that constantly checked the host file and edited it to add the list of blocked websites. I also had to figure out how to bypass Windows security, since editing a System 32 file is restricted by default.

Challenges I ran into

There were two major obstacles that I ran into. Firstly, I had to figure out how to bypass Windows security and allow my code to edit the host file. I also needed to learn how to read and write files, and utilize this in combination with loops to get my code to function.

Accomplishments that I'm proud of

This is my first hackathon, so the fact that I was able to complete my project was something I'm proud of. In addition, I was able to apply my knowledge of Windows 10 to my program to get it to work, which is pretty cool.

What I learned

I learned how to edit files using Python, which is very useful, and I will use the read, write, open, and close file functions in the future.

What's next for Website Blocker

I would like to add user input functionality, since you have to edit the program to choose what websites to block. I also want to add a timer, so you can, say, block YouTube from 8:30 am to 2:30 pm.

Built With

Share this project:

Updates