I'm trying to take the user's input, and see if there's a module named whatever they input. If there is, I then want that module to be imported, and to call a function within it of the same name. I know there are more simple ways of doing this, but I wanted to try and make it super compact.
This was my idea:
userinput = str.lower(input(prompt))
try:
import (userinput) as _(userinput)
_(userinput).(userinput)
except:
print("Module not found")
If it couldn't find a module with the name given, it would simply trip the exception and continue.
My problem is being able to import a module from the string given from the input.