This commit is contained in:
岛风 2024-01-08 17:29:28 +08:00
parent f5148e7d34
commit 3e4533f737

10
main.py
View File

@ -44,18 +44,24 @@ def main():
i = 0
j = 0
while(1):
ascii_tag()
if not network_test(): #网络异常
i +=1 #异常计数 3次失败重启
ascii_tag()
time.sleep(3)
else: #网络正常
i = 0
ascii_tag()
time.sleep(10)
if (i > 2): #异常3次
if (i > 2): #异常3次
if not network_restart(): #接口重启失败
ascii_tag()
print("接口错误,输入回车后退出。")
input()
exit()
else: #接口重启完成
i = 0
j += 1
ascii_tag()
time.sleep(10)
if __name__ == "__main__":