Python - passing a string as input to a command
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/967443/python-module-to-shellquote-unshellquote">Python module to shellquote/unshellquote?</a>  </p>
</blockquote>



<p>I am trying to pass a string's value into a command as input, in Python for executing a bash command. I currently have somthing like this:</p>

<pre><code>cmd = 'echo ' + &lt;StringValue&gt; + ' | command'
output = commands.getOutput(cmd)
</code></pre>

<p>but it does not work because my string value also contains both " and ', so it parses them wrong. Can anyone please tell me how I can pass this?</p>
