Programming-Idioms

History of Idiom 162 > diff from v13 to v14

Edit summary for version 14 :
New Python implementation by user [bugos]

Version 13

2019-10-08, 21:30:03

Version 14

2019-10-09, 15:56:42

Idiom #162 Execute procedures depending on options

execute bat if b is a program option and fox if f is a program option.

Idiom #162 Execute procedures depending on options

execute bat if b is a program option and fox if f is a program option.

Code
options = {
	'b': bat
	'f': fox
}

for option, function in options:
	if option in sys.argv[1:]:
		function()