Patrick Maupin <pmau...@gmail.com> writes:

> On May 19, 9:27 pm, Carbon <nob...@nospam.tampabay.rr.com> wrote:
> > subprocess.call(["/opt/2X/Client/bin/appserverclient", "-u
> > fieldValues [0]", "-p fieldValues[1]", "-s ts.mycompany.org:80", "-d
> > corp", "-S local", "-c 16", "-e 0xF", "-l 0x0409", "-a #1"])

As Patrick says, you need to give the arguments to the command as
the shell would pass them. That means option arguments separate from
value arguments, etc.

> I think, for example, instead of "-d corp", you want "-d" and "corp"
> in your list.

Right.

> I usually make a string like I would pass to bash, and then do
> .split() on it to get the list. This works fine unless you need
> embedded spaces anywhere.

Better is to use ‘shlex.split’ to split the string as a shell parser
would do <URL:http://docs.python.org/library/shlex#shlex.split>.

-- 
 \      “Not using Microsoft products is like being a non-smoker 40 or |
  `\     50 years ago: You can choose not to smoke, yourself, but it's |
_o__)               hard to avoid second-hand smoke.” —Michael Tiemann |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to