Executing the printed statement
<p>I have a print statement in python script.</p>

<pre><code>print "mysql -e\"insert into test.syllabalize values (",text_index, ",", index, ",", "'",syllable,"')\""
</code></pre>

<p>This output the correct mysql statement...</p>

<pre><code>mysql -e"insert into test.syllabalize values ( 3 , 5 , 'abc')"
</code></pre>

<p>How do I execute this statement?</p>

<p>It only prints it to the standard out.</p>

<p>Update:</p>

<p>The following will try to insert the text instead of the values of the variables.</p>

<pre><code>os.system('mysql -e"insert into test.syllabalize values (\'text_index\', \'index\', \'syllable\')"')
</code></pre>

<p>How do I replace the values with variables in the above statement?</p>
