当前正在尝试记录传出 TCP 连接列表,然后将当前列表与之前的列表进行比较,以查看已建立的连接。但是,TCPView.exe 似乎并不走运。我可以用这个运行应用程序:
def get_tcp_conns():
process = Popen([r"C:\Users\PC\Downloads\TCPView\Tcpview.exe"], stdout=PIPE, shell=True)
for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"):
print(line) # Do whatever here