Skip to content

Commit 4d182e7

Browse files
committed
优化格式
1 parent 243b10f commit 4d182e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ui/fun_bind.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ async def scan_port(ip, port, aa):
3535

3636
reader, writer = await asyncio.wait_for(asyncio.open_connection(ip, port), timeout=0.5)
3737
writer.close()
38-
res += f"{ip}:{port:05d}\t 连接成功\n"
38+
res += f"{ip}:{port} \t 连接成功\n"
3939
except asyncio.TimeoutError:
40-
res += f"{ip}:{port:05d}\t连接超时,端口可能关闭\n"
40+
res += f"{ip}:{port} \t 连接超时,端口可能关闭\n"
4141
except Exception as aa:
42-
res += f"{ip}:{port:05d}\t 尝试连接时出现异常 {type(aa).__name__}:{aa.__str__()}\n"
42+
res += f"{ip}:{port} \t 尝试连接时出现异常 {type(aa).__name__}:{aa.__str__()}\n"
4343

4444

4545
async def main_gen_res():
@@ -81,9 +81,9 @@ async def ip_scan2(ip, aa):
8181
ip = str(ipaddress.IPv4Address(ip))
8282
try:
8383
res = await aioping.ping(ip, timeout=2)
84-
res2 += f'{ip:16s}连接成功 延迟:{res * 1000:.3f}毫秒\n'
84+
res2 += f'{ip:16s} \t 连接成功 \t 延迟:{res * 1000:.3f}毫秒\n'
8585
except TimeoutError:
86-
res2 += f'{ip:16s}连接超时\n'
86+
res2 += f'{ip:16s} \t 连接超时\n'
8787

8888

8989
async def main_gen_res2():

0 commit comments

Comments
 (0)