title: Python - using a list in Popen as command
body: <p>I try to create a subprocess with Popen. Here is my code at first:</p>
  
  <pre><code>hostname = 'host'
  servername = 'server'
  commandargs = ['/usr/sbin/mminfo',' -o n',' -s',servername,' -q "client=\'',hostname,'\',savetime&gt;=last day"',' -r "client,name"']
  process = subprocess.Popen(commandargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  </code></pre>
  
  <p>The problem is that the executed command failed with a message, that the contacted server is not available. It seems that the variable hostname is not used...
  Trying the same with a string, instead of a list, as command in Popen (with Shell=True) everything is working fine.</p>
  
  <p>Does anyone know what is wrong with the code?</p>
  
  <p>Regards.
  Stefan</p>