I am trying to use functional programming to create a dictionary containing a key and a function to execute:
myDict={} myItems=(\"P1\",\"P2\",\"P3\",....\"
Simplify, simplify, simplify + DRY:
tasks = {} task = lambda f: tasks.setdefault(f.__name__, f) @task def p1(): whatever @task def p2(): whatever def my_main(key): tasks[key]()