Jun-23-2018, 01:37 PM
Maybe importlib can help you.
import importlib my_module = 'os' m = importlib.import_module(my_module) print(m.getenv("PATH"))