How to write an API for a Python application?

Cameron Laird claird at lairds.us
Thu Nov 17 07:08:03 EST 2005


In article <437b6d1a$1 at usenet01.boi.hp.com>,
dwelch  <donald.welch at hp.com> wrote:
>Gary Kshepitzki wrote:
>> Hello
>> I would like to create an API for a piece of Python code. The API is for use 
>> by non Python code.
>> It should support interaction in both directions, both accessing functions 
>> on the API and the ability for the API to raise events on its client.
>> What is the best way to do that?
>> I though of doing it as a python COM server but I am not familiar with COM 
>> and I saw that implementing a COM server with events in python is not 
>> trivial for me.
>> Is there a better (or simpler) solution?
>> What are the common ways for doing that?
			.
			.
			.
>You could try Elmer:
>http://elmer.sourceforge.net/index.html
>
>I'm sure you could create a callable library (.so, .dll, etc) with it.
			.
			.
			.
You guys work too hard.

My reaction is this:  Mr. Kshepitzki asks for an IPC choice,
says that COM looks like a bit too much, and respondents
start by loading him with even *heavier* technical alterna-
tives, such as CORBA.  Whew!  My recommendation:  a simple
project-specific line-oriented bilateral TCP/IP implementa-
tion.  Both server and client can listen for incoming
messages.  My guess is that the *... Cookbook* has a sketch
of this in a few dozen lines.  Perhaps after I've searched
it, I'll follow-up with a specific reference.



More information about the Python-list mailing list