import importlib, signal import outcomes import pipelines import curric2022 def handler(signum, frame): print("\n\nCancelled.\n\n") exit(1) def mainloop(): print ('') options = { 1: ['run sample course', curric2022.sampleclass], 2: ['pattern matcher style', curric2022.matchstyle], 3: ['pattern matcher - test on all classes', curric2022.match_style_test], 4: ['process all classes', curric2022.path_style_test], 5: ['process all programs', curric2022.path_style_prog], 6: ['show course outcomes', curric2022.all_outcomes], 7: ['Main outcome show & modify for a semester', outcomes.outcome_overview], 8: ['The outcome groups and links in iLearn', outcomes.outcome_groups], 9: ['Outcome report #2 sample', outcomes.outcome_report2], 10: ['Outcome groups dump', outcomes.outcome_groups_dump], 11: ['All outcomes attached to courses', outcomes.outcomes_attached_to_courses], 0: ['exit', exit], } for key in options: print((str(key) + '.\t' + options[key][0])) print('') #resp = eval(input('Choose: ')) resp = input('Choose: ') importlib.reload(outcomes) importlib.reload(pipelines) importlib.reload(curric2022) # Call the function in the options dict options[ int(resp)][1]() print("\n\n\n\n") mainloop() signal.signal(signal.SIGINT, handler) mainloop()