import string code example
Example 1: python how to import a module given a stringg
import importlib
i = importlib.import_module("matplotlib.text")
Example 2: string template python
from string import Template
poem = Template('$x are red and $y are blue')
print(poem.substitute(x='roses', y='violets'))
#>>>roses are red and violets are blue