MrPaan

Untitled

Nov 9th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import subprocess
  2. import time
  3.  
  4. while True:
  5. try:
  6. # Run wget with output redirected to /dev/null
  7. subprocess.run(["wget", "https://google.com/", "-O", "/dev/null"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
  8.  
  9. # Sleep for one second
  10. time.sleep(1)
  11. except KeyboardInterrupt:
  12. break # Exit the loop if Ctrl+C is pressed
Advertisement
Add Comment
Please, Sign In to add comment