title: Python - looping over files - order
body: <p>Does anyone know how Python arranges files when looping over them?
  I need to loop over some files in a folder in a fixed order (preferably alphanumerically according to the filenames), but Python seems to loop over them in a rather random order.
  So far I am using this code:</p>
  
  <pre><code>filelist = glob.glob(os.path.join(path, 'FV/*.txt'))
  for infile in filelist: 
    #do some fancy stuff
    print str(infile)
  </code></pre>
  
  <p>and the filenames are printed in an order not really obvious to me.</p>
  
  <p>Is there any simple way to predefine a certain order for that loop?
  Thanks!</p>