python网络中一元str的操作数类型错误

2024-03-28 20:05:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我在学习如何绑定和监听套接字,所以当我通过cmd编写连接到给定localhost的代码时,会出现以下错误。在

s.listen(5)

conn, addr = s.accept()

print('connected with: ', + addr[0] + ':' + str(addr[1]))

我得到了以下错误:

^{pr2}$

Tags: 代码cmdlocalhost错误withconnlistenaddr