I need to do something like that:
a = input('Import the package: ')
import a
Problem: a is a string. I do not know how to do it. The best idea I have is to do:
a = input('Import the package: ')
if a == 'numpy':
import numpy
But if I need to import many packages, this code can be difficult to read. a = 'numpy' is an example. I need this because I am writing a program that needs to import different scripts in different situations.