Skip to content

Instantly share code, notes, and snippets.

@nhammad
Last active June 20, 2020 22:30
Show Gist options
  • Save nhammad/b814562e694a130d9a1aba02ebd0cd9b to your computer and use it in GitHub Desktop.
Save nhammad/b814562e694a130d9a1aba02ebd0cd9b to your computer and use it in GitHub Desktop.
def check_validity(my_url):
try:
urlopen(my_url)
print("Valid URL")
except IOError:
print ("Invalid URL")
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment