How to communicate two separate python processes?

I have two python programs and I want to report them.

Both are system services, and none of them are forked by the parent process.

Is there any way to do this without using sockets?

(for example, by sorting a queue → serialize it → deserialize it by another process and make a connection, or write to the process ID of the file that is being contacted, and then create a magic structure that receives the process ID and sends some messages to this process ...)

The solution should work on Linux and Windows.

+5
source share
2 answers

Best of all, ZeroMQ , which is designed and runs very quickly on IPC (also supports TCP / multicast messaging), Python communications are really nice and easy to use. ZeroMQ has a good introduction with Python here: http://nichol.as/zeromq-an-introduction . If you plan to extend this on multiple computers, AMQP (which is the message queue protocol) will be useful; there are many great libraries for working with AMQP for python. I really like kombu and celery . You can also think of twisted , which gives you a pretty insane amount of communication options and a nice event loop to load.

+3
source

Linux . http://en.wikipedia.org/wiki/Named_pipe , / , .

, Windows .

+1

All Articles