def full_path_name(file_list): sorted_files = sort_files(file_list,'bin') for names in sorted(sorted_files.values()): print names
# -*- coding: utf-8 -*- import glob from lib4converter.lib4conv import sort_files def full_path_name(file_list): sorted_files = sort_files(file_list,'bin') for names in sorted(sorted_files.values()): print names if __name__ == '__main__': # Set path for testing files files_path = 'd:\\Programming\\Python_Projects\\soft4recieve_write' + \ '\\lib4converter\\test\\test_sort_files\\' # Create list of files for converting file_list = glob.glob((files_path) + '*.dat') # full_path_name(file_list) short_name = [name.split('\\')[-1] for name in file_list] # full_path_name(short_name) file_dict = sort_files(short_name,'bin') for ord_num in sorted(file_dict): ord_num = files_path + ord_num print file_dict[ord_num]