'How to import multiple modules in shell or script if condition is met

I am developing a little data analysis framework that depends on several packages. In particular I can import two packages only if a previous operation was successful. What I would like to do is to make a module that I can import, either in a script or in the shell, that automatically does the importing, so that I have all the required modules available without having to import them one by one.

Do you have any advice on how to do this?

I am also open to different solutions to do the importing automatically.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source