Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

go to python

def func1():
    ...

def func2():
    ...

funcmap = {1 : func1, 2 : func2}

def somefunc(a):
    funcmap[a]()  #Ugly!  But it works.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
1+8 =