Update app.py
Browse files
app.py
CHANGED
@@ -26,13 +26,20 @@ url = "https://146.152.226.61"
|
|
26 |
resp1 = requests.get("http://3.231.107.102")
|
27 |
print(resp1.status_code)
|
28 |
print(resp1.text)
|
|
|
29 |
|
30 |
while True:
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# one more
|
|
|
26 |
resp1 = requests.get("http://3.231.107.102")
|
27 |
print(resp1.status_code)
|
28 |
print(resp1.text)
|
29 |
+
print('Okay, I can connect to aws free test server.')
|
30 |
|
31 |
while True:
|
32 |
+
try:
|
33 |
+
resp2 = requests.get(url)
|
34 |
+
if resp2.status_code == 200:
|
35 |
+
print('Oh yeah, you are smart!')
|
36 |
+
break
|
37 |
+
else:
|
38 |
+
print('Oh no, you are getting smart! Work harder!')
|
39 |
+
print(resp2.status_code)
|
40 |
+
print(resp2.text)
|
41 |
+
except requests.exceptions.RequestException as e:
|
42 |
+
print('Oh no, no connection!')
|
43 |
+
print(e)
|
44 |
+
time.sleep(5)
|
45 |
# one more
|