需要一个整数(得到类型元组)错误

时间:2014-10-06 20:02:53

标签: python

我收到Python 3以下的错误 任何的想法?

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

1 个答案:

答案 0 :(得分:0)

尝试拨打clientDtSocket.sendto而不是clientDtSocket.send

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

有关这些方法的更多信息:https://docs.python.org/3/library/socket.html