title: Getting duration of all mp3 files inside catalog.
body: <p>For first: I am total beginner with Python.</p>
  
  <p>I just need to automate adding mp3 files to my shop. All of them are inside one catalog. Filename will be a Product Name, and file duration will be a Description of that product.</p>
  
  <p>I've wrote a simple Python script which reading all mp3 filenames from catalog and just printing them out. 
  It looks like this: </p>
  
  <pre><code>import os
  filenames = next(os.walk("./", topdown=True))[2]
  i = 0
  while i &lt; len(filenames):
      print(filenames[i].replace(".mp3", ""))
      i += 1
  </code></pre>
  
  <p>It works great but now I need to read duration of all *.mp3 files from the same catalog. </p>
  
  <p>I found library called <a href="https://github.com/quodlibet/mutagen" rel="nofollow noreferrer">Mutagen</a>.
  I can easily get duration of one file using this library but I can't read duration of files from whole catalog. </p>
  
  <p>Code for reading length of single mp3 file: </p>
  
  <pre><code>from mutagen.mp3 import MP3
  audio = MP3("example.mp3")
  print audio.info.length
  </code></pre>
  
  <p>Do you have any idea on how to read duration of all *.mp3 files inside one catalog and print them out? </p>