[Pythonmac-SIG] Simulating a Remote shell

Tom Fetherston ranch1@earthlink.net
Sun, 7 Jan 2001 21:26:23 -0500


Jack Jansen wrote:
>Tom,
>why not emulate the Python-shell in Python itself? Most of the
>emulated-mainloop code is available in IDE (and in IDLE too, and in
>various other places), and you could then just put, say, a socket
>wrapper around it, or an AppleScript wrapper, or whatever you would
>want.

I suspected that was the case, but can't sya that I have much more than are
reading familiarity with python yet.  Most of my coding in it so far is cut
paste and modify stuff, so help just locating the above mentioned code
would be helpful.

As to the other thing I would like to do with PythonSlave.py, provide an
appleEvent to fake up a command line invocation with arguments, I been
thinking that using the optional namespace parameters of exec would be part
of the solution, after all once it is parsed the command line exists as a
list; sys.argv at the global level.  How can I create a namespace with at
least sys.argv initialized to pass to exec?  I tried just writting:
exec { sys.argv = ['test.py', 'a', b'] }
but that did not do the trick.

Tom