Question

I am quite new to Python and recently I wanted to send some files using Python. I quickly found out about sockets. But I searched for ready-made solution, because I thought client-server communication is such a common use, there must exist some kind of library (or maybe it's just because of my Java background and I got used to it:D). All answers about sending files I found mentioned sockets and that 'you have to write a protocol yourself'.

So here's my question: is there any library, ready protocol for client-server communication in Python (preferably 2.7)?

Was it helpful?

OTHER TIPS

If you use sockets, you can use ssh and then do scp (secured copies). If you are moving files back and forth, that would probably be the easiest way.

Maybe zeromq is something for you! There are also python bindings available. And good examples for implementing a Publisher-Subscriber pattern are also well documented.

is there any library, ready protocol for client-server communication

Generally speaking, yes: sockets (which you already found), twisted (as pointed in another answer) etc.

I wanted to send some files using Python

Use ftp! You can start an FTP server using pyftpdlib and use ftplib as client.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top