在python中通过TCP发送不同的数据形式/类型
import socket
s = socket.socket()
port = 12345
s.connect(("127.0.0.1, port))
a = "Hii"
b = 25
c = b'\xAA\xEE'
s.send(a,b,c)
s.close()
问题1. 有没有办法可以同时发送所有三个a、b、c,而不是发送3 次。
问题 2. 如果所有 3 个都是字节,那么有没有办法将它们连接起来并发送?
import socket
s = socket.socket()
port = 12345
s.connect(("127.0.0.1, port))
a = "Hii"
b = 25
c = b'\xAA\xEE'
s.send(a,b,c)
s.close()
Question 1. Is there a way that I can send all three a,b,c at the same time, rather than sending 3 times.
Question 2. If all 3 are in bytes then, is there a way I can concatenate them and send?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论