0

I have python array with filepath in it, I need to sort the files path based on created date. Is there any inbuilt functionality exist for it.

  files = ["/path1/filename.text", "/path2/filename.text", "/path2/filename.text"] 
CodeDezk
  • 1,230
  • 1
  • 12
  • 40
  • 1
    Here is another possible duplicate, https://stackoverflow.com/a/539024/4985099 – sushanth Aug 05 '20 at 11:34
  • The above link demonstrates how to get the creation date for a file. You can use this as the `key` argument in `sorted` for example https://stackoverflow.com/questions/5213033/sort-a-list-of-lists-with-a-custom-compare-function – Cory Kramer Aug 05 '20 at 11:34
  • Thanks, I will try it. – CodeDezk Aug 05 '20 at 11:40

0 Answers0