Request Help With Function

Ian Kelly ian.g.kelly at gmail.com
Mon Apr 4 15:54:56 EDT 2016


On Mon, Apr 4, 2016 at 1:42 PM, Wildman via Python-list
<python-list at python.org> wrote:
>     commandlist = commandlist.split(",")

commandlist is a list.

>                 command = [target, commandlist]
>                 subprocess.Popen(command)

This is passing a list containing two elements: the first is a string,
and the second is a list of strings. You should just pass a list of
strings. Probably you wanted to do this:

    command = [target] + commandlist



More information about the Python-list mailing list