title: How to inherit from one of two base classes, deciding on runtime
body: <p>A Base class named MyClass is present in one file and another Base class MyClass1 is present in another file.</p>
  
  <p>I have two platforms suse10 and suse11 linux. I have a script where based on the platform MyClass.py file will be disabled for suse10 and MyClass1 will be disabled for suse11.</p>
  
  <p>Now i want another Class in another file common for both the platforms to inherit any one of these classes based on the platform. How can i do it </p>
  
  <p>Let us consider MyClass.py to be </p>
  
  
  
  <pre class="lang-py prettyprint-override"><code>class MyClass(AbsClass):
      def __init__(self,Sample):
           /*Constructor func*/
  
      /*Class Func*/
  </code></pre>
  
  <p>And MyClass1.py be</p>
  
  <pre class="lang-py prettyprint-override"><code>class MyClass1(AbsClass):
      def __init__(self,Sample):
          /*Constructor func*/
  
      /*Class Func with some additional functionalities*/
  </code></pre>
  
  <p>I want SubClass.py file as</p>
  
  <pre class="lang-py prettyprint-override"><code>from MyClass import MyClass
  from MyClass1 import MyClass1
  class SubClass(MyClass or MyClass1 based on which is enabled):
      def __init__(self,Sample):
          MyClass.__init__(self,Sample):
  </code></pre>
  
  <p>In the script</p>
  
  <pre class="lang-py prettyprint-override"><code>if PLATFORM==suse10
      rm -r MyClass.py /* Deletes and disables it */
  elif PLATFORM==suse11
      rm -r MyClass1.py /* Deletes and disables it */
  </code></pre>
  
  <p>Consider this as a abstract code .Also consider there are 100 platforms which enable and disable the python files. How can i dynamically load the class files using the existence of the class </p>