Python as network protocol

Aahz aahz at pythoncraft.com
Sun Nov 15 01:22:30 EST 2009


In article <e16564d8-6e3e-4973-be9c-1e2c81fcec51 at h34g2000yqm.googlegroups.com>,
Cooch  <kochkin.dmitry at gmail.com> wrote:
>
>I want to implement such specific feature:
>I have a server written in Python. I have a client written in C++. I
>want to use Python as network protocol between them. I mean: client
>send to server such string: "a = MyObject()", so object of this type
>will appear in server. Any ideas how to simplify this implementation?
>I make XML-RPC/SOAP server using twisted which just execute sended
>string. But I don't know how to:
>1. Restrict usage of some modules on client side (os, sys etc..)
>2. Divide variables of different clients. Generally, I know that I
>should use "exec .. in .. " construct, but don't know how to
>distinguish between clients in twisted.

What you want is a DSL -- domain-specific language.  That might be a
subset of Python that you parse yourself.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

[on old computer technologies and programmers]  "Fancy tail fins on a
brand new '59 Cadillac didn't mean throwing out a whole generation of
mechanics who started with model As."  --Andrew Dalke



More information about the Python-list mailing list