There's an excellent answer for the same question for Python 2: Importing module from string in the Python C API
I tried that in Python3 but it seems that this doesn't work anymore. The code compiles but when I try to do print(blah)
I get:
Traceback (most recent call last):
File "<string>", line 9, in <module>
NameError: name 'blah' is not defined
Does anyone know what could have changed?