Python Forum

Full Version: How to call a method in a module using code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone


I've question concerning calling methods just using code.

The general idea is that I can give a name of a module and a method in that module so the code will recognize it and run it.

Is there a way of doing such a thing?
Is it this what you ask for? Check all 3 parts of the tutorial.
First of all, thanks for the response

Yes this solves my question but only partly. I know how to import modules by name and calling methods by doing so but the only problem is that I'm passing through the module name using an argument.

Is there a way to import the module by using a parameter as the module name?
Thanks a lot! This solved my problem :D