title: Most Pythonic and fastest way to change a file name extension, if it's uppercase, to lower case
body: <p>I have a list of files and some of them have upper case file name extensions, eg file.PDF. In these cases, i would like to change the upper case to lower case, eg file.pdf</p>
  
  <p>I came up with this solution</p>
  
  <pre><code>currentDir = 'theDirectory'
  for file in os.listdir(currentDir):
      print(file)
      if file[-3:] == 'PDF':
          oldName = currentDir+'/'+file
          newName = currentDir+'/'+file[:-3]+'pdf'
          os.rename( oldName ,  newName )
  </code></pre>
  
  <p>I'll be dealing with millions of files, daily, so it's important that it's the most efficient method possible. </p>
  
  <p>Is there a better way than the solution above ? </p>