12 lines
355 B
Python
12 lines
355 B
Python
import urllib.request
|
|
try:
|
|
r = urllib.request.urlopen('http://localhost:8017/', timeout=5)
|
|
print('localhost OK:', r.status)
|
|
except Exception as e:
|
|
print('localhost FAIL:', e)
|
|
try:
|
|
r = urllib.request.urlopen('http://127.0.0.1:8017/', timeout=5)
|
|
print('127.0.0.1 OK:', r.status)
|
|
except Exception as e:
|
|
print('127.0.0.1 FAIL:', e)
|