python try import string code example Example: python how to import a module given a stringg import importlib i = importlib.import_module("matplotlib.text")