Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用以下代码,有没有办法指定我不关心返回的元组的“地址”部分?
(data, address) = socket.recvfrom(512)
理想情况下,我想做这样的事情:
data = socket.recvfrom(512)
谢谢!
data = socket.recvfrom(512)[0]
选项一,只需抓住您感兴趣的元素:
选项二,使用一个告诉读者你不在乎的词:
data, dummy = socket.recvfrom(512)