I don't know if there is an easier way to write this in python
there are 2 menus thats the user can choose from, user_choice and action
#SEARCH BY NAME
if user_choice == '1' and action == '1':
print_files((search_by_name(all_list)))
elif user_choice == '1' and action == '2':
print_first_line_of_text((search_by_name(all_list)))
elif user_choice == '1' and action == '3':
copy_file((search_by_name(all_list)))
elif user_choice == '1' and action == '4':
touch_file((search_by_name(all_list)))
###############
#SEARCH BY NAME ENDING
elif user_choice == '2' and action == '1':
print_files((search_by_name_ending(all_list)))
elif user_choice == '2' and action == '2':
print_first_line_of_text((search_by_name_ending(all_list)))
elif user_choice == '2' and action == '3':
copy_file((search_by_name_ending(all_list)))
elif user_choice == '2' and action == '4':
touch_file((search_by_name_ending(all_list)))
#################
#SEARCH BY SIZE
elif user_choice == '3' and action == '1':
print_files((search_by_size(all_list)))
elif user_choice == '3' and action == '2':
print_first_line_of_text((search_by_size(all_list)))
elif user_choice == '3' and action == '3':
copy_file((search_by_size(all_list)))
elif user_choice == '3' and action == '4':
touch_file((search_by_size(all_list)))
############
there are 2 menus thats the user can choose from, user_choice and action