Can someone tell me why this doesn't work?
m = importlib.import_module('operator')
eval('operator.add') # returns NameError
I know I can use m.add
but I can't do that as I am reading the input to eval
from a file. Is there a way I can get m
to be loaded into the current runtime?