Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. host_temp = "hosts"
  2. host_path = r"C:\Windows\System32\drivers\etc\hosts"
  3. redirect = "127.0.0.1"
  4. website_list =['www.facebook.com','facebook.com']
  5.  
  6. while True:
  7. if dt(dt.now().year,dt.now().month,dt.now().day,8) < dt.now() < dt(dt.now().year,dt.now().month,dt.now().day,16):
  8. print("working")
  9. with open(host_temp,"r+") as file:
  10. content = file.read()
  11. for website in website_list:
  12. if website in content:
  13. pass
  14. else:
  15. file.write(redirect+" "+ website+"\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement