title: How do I import a module only when needed?
body: <p>I am writing different python modules for gupshup, nexmo, redrabitt, etc. service providers.</p>
  
  <pre><code>#gupshup.py
  class Gupshup():
      def test():
          print 'gupshup test'
  </code></pre>
  
  <p>All the other modules have test() method with different content in them. I know whose test() to call. I want to write another module <em>provider</em>, which will look like -  </p>
  
  <pre><code>#provider.py
  def test():
      #call test() from any of the providers
  </code></pre>
  
  <p>I will pass some sting data as a command line argument which will have the name of the module.</p>
  
  <p>But I don't want to import all the modules with <code>import providers.*</code> and then call the method like <code>providers.gupshup.test()</code>. Just by knowing whose test() I am going to call at run time, how do I load only nexmo module when I want to call it's test method?</p>