title: Get a sorted list of folders based on modification date
body: <p>I am trying to figure out how to apply a Python function to the oldest 50% of the sub-folders inside my parent directory.    </p>
  
  <p>For instance, if I have 12 folders inside a directory called <code>foo</code>, I'd like to sort them by modification date and then remove the oldest 6. How should I approach this?</p>