Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from urllib.request import urlopen
- #dna.py
- #Domain Name Available ?
- """
- Console App
- Receives a domain name
- Prints:
- "http available" if there is http content at the domain
- "http not available" if there is NOT http content at the domain
- """
- bCorrectUsage = len(sys.argv)==2
- if (bCorrectUsage):
- strDomainName = sys.argv[1]
- try:
- strHttpsForDomain = \
- "http://"+strDomainName
- urlopen(strHttpsForDomain)
- print ("HTTP available!")
- except:
- print ("HTTP NOT available")
- #TODO
- else:
- pass
- #TODO : explain how to use
Advertisement
Add Comment
Please, Sign In to add comment