I compiled a python executable with py2exe and want to import a python module by a user input.
userinput = input("Enter module name")
module = __import__(userinput)
Does this work? Or is there another way to import a module after the file is compiled?
You could try
importlib.import_module()
: