Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python)': 0.05; 'ascii': 0.07; 'character,': 0.07; 'json': 0.07; 'system;': 0.07; 'inclined': 0.09; 'sockets': 0.09; 'am,': 0.12; 'things.': 0.12; 'debugging': 0.13; 'received:209.85.210.174': 0.13; 'received :mail-iy0-f174.google.com': 0.13; 'protocol': 0.15; 'bytes).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gained': 0.16; 'non-python': 0.16; 'said.': 0.16; 'tcp/ip,': 0.16; 'wrote:': 0.18; 'possibly': 0.19; 'written': 0.20; "aren't": 0.21; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; "python's": 0.24; 'specify': 0.24; "i'm": 0.26; 'message-id:@mail.gmail.com': 0.28; 'server': 0.30; '(since': 0.30; 'can,': 0.30; 'protocols': 0.30; 'subject:some': 0.30; "they'll": 0.30; 'chris': 0.30; "i'll": 0.31; 'andrew': 0.32; 'thu,': 0.32; 'to:addr:python-list': 0.34; 'anything': 0.34; 'languages.': 0.34; 'posters': 0.34; 'something': 0.35; '...': 0.36; 'question': 0.36; 'but': 0.37; 'received:google.com': 0.37; "there's": 0.37; 'think': 0.37; 'could': 0.37; 'using': 0.38; 'received:209.85': 0.38; 'manually': 0.39; 'client': 0.39; 'should': 0.39; 'define': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; 'your': 0.61; 'ever': 0.65; 'transfer': 0.72; 'stream': 0.77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cbiPfkAWBX/V/oL3vehu1OMyZ8BNtbSPGxAbG7kqQck=; b=toxIB9f4h3kKVejkUhA71acPRx/3tNN1PCrM+UaL3LG+4faVH/Rq8zZxlBcfa3x9vE q2W4cK3mW32t5QoJrBjWxeZc9osSVw2MvGefa9YvRBhwEW1Pkcd1wxWSkbFF5JHlMrTi dg4CiPbJ+zqx7UZ5mHHSNYMd9fhK0sGZWWhVU= MIME-Version: 1.0 In-Reply-To: <4ED69A1A.3080609@gmail.com> References: <4ED69A1A.3080609@gmail.com> Date: Thu, 1 Dec 2011 13:14:26 +1100 Subject: Re: Need some IPC pointers From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322705669 news.xs4all.nl 6848 [2001:888:2000:d::a6]:52106 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16466 On Thu, Dec 1, 2011 at 8:03 AM, Andrew Berg wrote: > processes (that aren't necessarily written in Python) ... > non-local processes would be nice ... > The implementation needs to be cross-platform ... > I don't think I'll ever need to transfer anything complicated or large - > just strings or possibly tuples/lists. > I'm thinking sockets, but perhaps there's something simpler/easier. Definitely sockets, as other posters have said. The only question is, what encapsulation format (since sockets give just a stream of bytes). Since you want non-Python processes to be involved, I would be inclined to avoid using Python's own pickling system; JSON may be viable, and it's well known so you should be able to find support in other languages. Alternatively, take a careful look at your dataset and invent your own system. If your strings will never contain a pipe character, you could define a tuple/list to be simply pipe-separated strings; if they'll never contain newlines, you can specify your protocol to be newline-terminated. For command/response protocols over TCP/IP, I strongly recommend poking around with existing protocols such as the email trio (SMTP, POP, and IMAP); there's many good ideas to be gained from them. If you can, try to keep your protocol to ASCII text. It makes debugging far easier, as you can simply point a telnet/mud client at your server and manually step through things. Chris Angelico