[Tutor] How to implement portable message queue betwwen Pytho n application and another application ??

alan.gauld@bt.com alan.gauld@bt.com
Tue, 11 Sep 2001 13:10:41 +0100


> I need to send data from Python interface to the C 
> application which is running indipendently. 

So you need a platform indepoendant way of intefacing Python to a C
application.

There are two easy ways:

1) Use sockets(see below)

2) If you control the C app use text files. Get the C app 
and Python app to poll the files(In background threads)

IMHO 1 is easier 2 is robuster but slower.

> What is general way of implementing message queues (for 
> sending messages from python to another application.), 

I don't think there is one thats common to both Win32 
and Linux. 

ng
> socket pipe (in the same system). But I really don't what are 
> the drawbacks when I implement using sockets rather than 
> use normal approch of sending messages using message ques..,

I think on Linux sockets are the normal approach!
The disadvantages are the need to marshal data in and out 
of the sockket. Only a problem if you don't own both ends 
or the interface changes regularly.

Alan G