Use module as text in Python : I have a dictionary that contains modules, now I would like to use the string value of the module (see example). Is this possible or am I better of just creating a second dictionary?

```python
import module1
import module2
import module3

module_dict = {
    'module1' = module1
    'module2' = module2
}

user_input = input()
module_dict[user_input].function()

#module3.function requires two strings to work, one of the string happens to be the name of the module
module3.function('foo', module_dict[user_input])
``` 

This is a really simplified version, forgive me if it looks confussing. I can not use the built-in ```str``` function since it will result in ```module 'modulename' at 'path'``` which is not what I am after.