это довольно сложная задача для начинающих, так как я очень плохо знаком с программированием ... было бы очень любезно с вашей стороны, если бы вы могли вести меня
import time
from datetime import datetime as dt
host_file = r"C:\Windows\System32\drivers\etc\hosts"
host_temp = "hosts"
redirect = "127.0.0.1"
website_list=['facebook.com','www.facebook.com']
while True:
if dt(dt.now().year,dt.now().month,dt.now().day,8) < dt.now() < dt(dt.now().year,dt.now().month,dt.now().day,18):
print("working hours .....")
with open(host_temp , "r+") as file:
content = file.read()
for web in website_list:
if web in content:
pass
else:
file.write(redirect+website_list)
else:
print("fun hours .....")
time.sleep(5)