From d0d9e2623d65cf1a81f824ec449cf1cced1ebf6e Mon Sep 17 00:00:00 2001 From: clonbg Date: Fri, 9 Feb 2024 14:40:10 +0100 Subject: [PATCH] add comments --- init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.py b/init.py index 78f26d6..4dd9101 100644 --- a/init.py +++ b/init.py @@ -2,13 +2,15 @@ from os.path import exists import requests from time import sleep +# bucle infinito while True: + # Si está online req = requests.get("http://ipinfo.io/ip") while int(req.status_code) != 200: sleep(60) req = requests.get("http://ipinfo.io/ip") - ip = req.text + # existe archivo con la antigua ip file_exists = exists("old_ip.txt") if not file_exists: