[svn r37647] make the example independent from the installed python binaries

--HG--
branch : trunk
This commit is contained in:
hpk 2007-01-31 00:46:20 +01:00
parent 89a4750535
commit bd71dff595
1 changed files with 8 additions and 5 deletions

View File

@ -85,11 +85,14 @@ communicate data in a structured way. Here is
an example: an example:
>>> import py >>> import py
>>> gw = py.execnet.PopenGateway(python="python2.3") >>> gw = py.execnet.PopenGateway()
>>> channel = gw.remote_exec("import sys ; channel.send(sys.version_info)") >>> channel = gw.remote_exec("""
>>> channel.receive()[:2] ... import os
(2, 3) ... channel.send(os.getpid())
>>> gw.exit() ... """)
>>> remote_pid = channel.receive()
>>> remote_pid != py.std.os.getpid()
True
`remote_exec` implements the idea to ``determine `remote_exec` implements the idea to ``determine
protocol and remote code from the client/local side``. protocol and remote code from the client/local side``.