如何通过python中的套接字发送数组 [英] how to send an array over a socket in python
本文介绍了如何通过python中的套接字发送数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个([1,2,3,4,5,6],[1,2,3,4,5,6])
的数组类型.我必须通过python中的STREAM/TCP套接字发送它.然后,我必须在接收端接收相同的数组.
I have an array kind of ([1,2,3,4,5,6],[1,2,3,4,5,6])
this. I have to send it over a STREAM/TCP socket in python. Then I have to receive the same array at the receiving end.
推荐答案
您可以序列化对象,然后再将其发送到套接字,并在接收端对其进行反序列化.检查此
You can Serialize the object before sending to socket and at receiving end Deserialize it. Check this
这篇关于如何通过python中的套接字发送数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文