Browse Source

Add httpConnectionTester.py via upload

PythonCoder8 4 years ago
parent
commit
1f51cedddc
1 changed files with 11 additions and 0 deletions
  1. 11 0
      httpConnectionTester.py

+ 11 - 0
httpConnectionTester.py

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