I have a list of Strings that looks like that:
['training_tech26.txt', 'training_tech41.txt', 'training_tech68.txt', 'training_tech84.txt', 'training_tech52.txt', 'training_sales17.txt', 'training_sales2.txt', 'training_tech47.txt', 'training_sales23.txt', 'training_sales3.txt', 'training_tech9.txt', 'training_tech12.txt']
I need to sort these files to be in a right order, like:
['training_tech1.txt', 'training_tech2.txt', 'training_sales3.txt', 'training_tech4.txt', 'training_tech5.txt']
I am using these code to access all files inside my folder and append them into one list. In the folder itself they are placed in a right order, so I don't know why there are messed up in this list.
tech_dir_path = "/path/to/folder/with/files"
res = []
tech_res = os.listdir(tech_dir_path)