[python-win32] Passing arguments/values back and forth between separate executables at/during runtime

Tim Roberts timr at probo.com
Thu Apr 24 00:45:52 CEST 2014


Jacob Kruger wrote:
> ... 
> Alternatively, what would maybe be a better method for passing
> string/numeric values back and forth between two separate executables
> in this style/sense?
>  
> Something like peek/poke back in ooooold days, or something like
> writing values to windows registry?  Don't think that it should really
> be necessary, and think something as simple as either just passing
> values back and forth in temporary text files, or sqlite database
> files, or even just pickled python objects could do the trick, but,
> what do you guys think?

The Google search term you want is "interprocess communication."  There
are a number of ways to do this, although many of them tend to be
system-dependent.

Windows has the concept of a memory-mapped files -- essentially a chunk
of memory pages that can be shared between multiple processes.  That's
awfully easy, but I don't know if there is a Python mapping.  You'd be
responsible for wrapping a communication scheme around that.

Windows and Linux both have the concept of named pipes, which are very
much like network sockets that don't happen to travel across a network.

Heck, even a traditional TCP socket would work for your purpose.  They
are very easy to handle in Python, and it would even let you split your
work across several computers.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140423/1ed8ebd4/attachment.html>


More information about the python-win32 mailing list