Skip to content

Tag: sockets

python 3.6 socket pickle data was truncated

I can not send my numpy array in socket. I use pickle but my client pickle crashes with this error: pickle data was truncated My server : I create a numpy array and I want to send in my client with pickle (it’s work) My client He has my numpy array, but I can not load with pickle. I have

Socket Programming with Python server and Android client

I want to setup a socket interface. PC side runs a very simple socket server written in Python to test the connection: An Android client application will connect to PC: However, I cannot establish a connection between PC and Android device. Any idea to fix this? Answer As you haven’t detailed if you&#82…

Python. Redirect stdout to a socket

I run my script on computer “A”. Then I connect to computer “A” from computer “B” through my script. I send my message to computer “A” and my script runs it with an exec() instruction. I want to see the result of executing my message on computer “A”,…

Handling a timeout error in Python sockets

I am trying to figure out how to use the try and except to handle a socket timeout. The way I added the socket module was to import everything, but how do I handle exceptions? In the documentation it says you can use socket.timeouterror, but that doesn’t work for me. Also, how would I write the try exce…