Python 需要整数(获取类型元组)错误

Python 需要整数(获取类型元组)错误,python,Python,我在Python3 有什么想法吗 clientDtSocket.send(bytes(fileName,"UTF-8"),("localhost",8101)) TypeError: an integer is required (got type tuple) 尝试调用clientDtSocket.sendto而不是clientDtSocket.send: clientDtSocket.sendto(bytes(fileName,"UTF-8"),("localhost",8101)) 有

我在
Python3
有什么想法吗

clientDtSocket.send(bytes(fileName,"UTF-8"),("localhost",8101))
TypeError: an integer is required (got type tuple)

尝试调用
clientDtSocket.sendto
而不是
clientDtSocket.send

clientDtSocket.sendto(bytes(fileName,"UTF-8"),("localhost",8101))

有关这些方法的更多信息:

请发布您的代码;不是所有人都是通灵的。
(“localhost”,8101)
不是元组吗?这是您想要的参数吗?我还猜将
(“localhost”,8101)
传递给
发送
方法是一个问题。
clientDtSocket是如何初始化的?请注意
“127.0.0.1”
通常比
“localhost”
快,因为后者会进行额外的DNS查找。