W
WH
Hi,
I want to use one of two functions in a script:
def func_one(): pass
def func_two(): pass
func = getattr(x, 'func_'+number)
func()
'x' in getattr() should be a reference to the "__main__" module, right?
How to get it? The 'if' clause should work here. I am just curious if
we can use the above method.
Thanks,
-WH
I want to use one of two functions in a script:
def func_one(): pass
def func_two(): pass
func = getattr(x, 'func_'+number)
func()
'x' in getattr() should be a reference to the "__main__" module, right?
How to get it? The 'if' clause should work here. I am just curious if
we can use the above method.
Thanks,
-WH