httpConnectionTester.py 397 B

1234567891011
  1. #Test internet connection via HTTP protocol
  2. #Developed by: Cybergavin, PythonCoder8
  3. #Required packages: sys (pre-installed with Python 3), requests
  4. from sys import argv
  5. import requests
  6. requests.packages.urllib3.disable_warnings()
  7. try:
  8. r = requests.get(argv[1], verify=False)
  9. print('Succeeded to connect to "%s"'%(argv[1]))
  10. except:
  11. print('Failed to connect to "%s"'%(argv[1]))