wed_result.append(each_day) for each_month in sat_day_result: for each_day in each_month: sat_result.append(each_day) for each_month in sun_day_result: for each_day in each_month: sun_result.append(each_day) ### ===== Save parsed data to separate txt file ===== ### print "Save all result" print "Wednesday" write_to(wed_result) print "Saturday" write_to(sat_result) print "Sunday" write_to(sun_result) print "Saving all combined result completed" print print print "Save i12 num with TOP3 sort" print "wednesday" write_to(sort(num_cat_sorter(wed_result,2),2)) print "sat" write_to(sort(num_cat_sorter(sat_result,2),2)) print "sun" write_to(sort(num_cat_sorter(sun_result,2),2)) print "========== END OF EXECUTION =========="
## ===== Number Analysis ===== ## result_combined = [] for each in result_raw: new = combine(each) result_combined.append(new) # just take i12 num i12 = [] for each in result_combined: new = num_cat_sort_module.get_i12(each) i12.append(new) # sort to get TOP3 prize i12_TOP3 = [] for each in i12: new = sort(each, 2) i12_TOP3.append(new) # separate top 50 of TOP3 into list according to each double digit i12_TOP3_top50_separated = [] for each in i12_TOP3: new = separate(each[:50]) i12_TOP3_top50_separated.append(new) # append each double digit count into a list for easy display i12_TOP3_top50_digit_count = [] for each in i12_TOP3_top50_separated: digit_count = [] for one in each: digit_count.append(len(one)) i12_TOP3_top50_digit_count.append(digit_count)
from file_handler import read_from from parsing_module import print_each from num_cat_sort_module import num_cat_sorter from sorting_module import sort file_name = "2014_sat_all.txt" data_file = read_from(file_name) num_i12 = num_cat_sorter(data_file, 2) num_i12_sort_top3 = sort(num_i12,2) top50_i12_top3 = num_i12_sort_top3[:-5] print_each(top50_i12_top3)