Recording history of users and blocking user-specified websites during a certain period of time in a day by editing the Host file from Python.
Before you continue, ensure you meet the following requirements: You have installed Python
You have an Admin access
Before you start writing code, it’s important to ensure you have Python installed as well as the proper modules.
- Step One: Go to https://www.python.org, navigate to the downloads section and download the latest version of python.
- Step Two: Go through the setup wizard and make sure to install pip as well as add python to the path (screenshot credit: Data to Fish)
- Step Three: Go to https://www.jetbrains.com/pycharm/download/#section=windows, under Community, choose the free download option. Go through the setup wizard using default options.
- Step Four: Open PyCharm once downloaded and select Create New Project (screenshot credit: BeginnersBook) Once package has been successfully installed, we can move onto the next module to install. For this project, install all of the following modules (name is exactly the name of the package)
- pywin32
- pynput
- scipy
- cryptography
- requests
- pillow
- sounddevice Once you have imported all modules, exit out all of settings windows and wait a few minutes for each package to install. You have successfully installed python, PyCharm, and all required modules
For example :
pip install pywin32
Open the script using pythonw.exe so that it would run as a background task. Automatically run the script file at Start-up as a backgroud task on Windows 10 using Task scheduler. ##What you will see when the website you are trying visit is blocked