测试demo

This commit is contained in:
gfdgd xi 2024-01-29 19:19:36 +08:00
parent 67e8e18237
commit 13708434c9
2 changed files with 23 additions and 0 deletions

1
.gitignore vendored

@ -1,2 +1,3 @@
*.user*
.qmake.stash
__pycache__

22
Host/mainwindow.py Normal file

@ -0,0 +1,22 @@
import time
import socket
import traceback
while True:
try:
s = socket.socket()
s.connect(("127.0.0.1", 8080))
info = "Apple".encode("utf-8")
len = s.send(info)
ret = s.recv(1024)
if info == ret:
print("success")
break
except:
traceback.print_exc()
time.sleep(0.1)
exit()
while True:
if not ret:
s.close()