mp3info giving an error with variable filename
<p>I have been using mp3info to calculate my file length using the following syntax:</p>

<pre><code> mp3info -p "%S" /path/to/file
</code></pre>

<p>whenever I use the code with the filename I get the correct output:</p>

<pre><code> mp3info -p "%S" far_from_love.mp3
</code></pre>

<p>However, on storing the filename in a string variable and then using the variable I get an error:</p>

<pre><code> SyntaxError: invalid syntax
</code></pre>

<p>Could anyone tell me how to correctly use the command with a variable filename?</p>

<p>this is the python code which uses mp3info</p>

<pre><code>listing=os.listdir("C:\\Python27")
for f in listing:
    if fnmatch.fnmatch(f,'*.mp3'):

         ext=f[:-4]                             #extract name of file without extension
         WAVE_OUTPUT_FILENAME="%s.wav"%ext
         print WAVE_OUTPUT_FILENAME#save output filename as wav extension
         print f
         x=os.popen('mp3info -p "%S" f).read()
         print x
</code></pre>
