Advertisement
Guest User

Untitled

a guest
Nov 25th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. try:
  2.     output = subprocess.check_output("ping -c 1 %s" % LINK, shell=True)
  3. except:
  4.     print("Invalid URL")
  5.  
  6. OUTPUT
  7. LINK = https://www.youtube.c
  8. -->
  9. ping: www.youtube.c: Name or service not known
  10. Invalid URL
  11. >>
  12.  
  13. LINK = https://www.youtube.com
  14. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement