Short version:
Say I have a string str and a file functions.py from which I would like to import a method whose name is stored in str.
How do I go about it? I would like something like:
from functions.py import str
but have str evaluated and not to import the method 'str' (which doesn't exist).
After some googling I came as close (I hope) as:
func_name = str
_tmp = __import__('functions.py', globals(), locals(), ['func_name'], -1)
func = ???? <what to put here?>
Thanks in advance.
EDIT: TMI.
functionsand notfunctions.py.