Chris Rebert <c...@rebertia.com> writes:

> Use the `subprocess` module instead (with shell=False). You then won't
> need to worry about escaping.
> http://docs.python.org/library/subprocess.html

You will still need to worry about escaping because on the remote end
you invoke ssh which is a shell. The obvious call:

subprocess.call(["ssh", "remoteuser@remote", "python", "remote.py", "arg
1", "arg 2", "arg 3"])

won't work because ssh will break up the "arg n" strings. You need to
use  "'arg n'" or put the whole python command in a string like:

"python TEST/testargs.py 'arg 1' 'arg 2' 'arg 3'"
-- 
Piet van Oostrum <p...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to