* TypeError - Need help passings args
juho.schultz at helsinki.fi
Wed Nov 2 16:20:11 CET 2005
> My program is below. I'm trying to use two Windows ".exe" files with
> my command line python interface. I get user input, then call
> "launchWithoutConsole". This was working OK until I introduced the
> 'args' part. Now I get the following error everytime I call
> return subprocess.Popen([command] + args,
> TypeError: can only concatenate list (not "str") to list
> I'm not sure if it's the WAY I'm passing it or if it's the function
> itself (which I retrieved from
> Please help. Thanks!
[command] is a list. So also "args" should be a list,
otherwise [command] + args produces an error.
Add a few square brackets to the calls, just like in the link.
More information about the Python-list