In Ruby, instead of repeating the "require" (the "import" in Python) word lots of times, I do
%w{lib1 lib2 lib3 lib4 lib5}.each { |x| require x }
So it iterates over the set of "libs" and "require" (import) each one of them. Now I'm writing a Python script and I would like to do something like that. Is there a way to, or do I need to write "import" for all of them.
The straight-forward "traduction" would be something like the following code. Anyway, since Python does not import libs named as strings, it does not work.
requirements = [lib1, lib2, lib3, lib4, lib5]
for lib in requirements:
import lib
Thanks in advance