python os sort through files by name code example Example: sort files in windows order python from tkinter import Tcl Tcl().call('lsort', '-dict', file_list)