title: How to call a method from a different file without importing it in python
body: <ol>
  <li>MainLibrary.py - All the important methods are available in this file</li>
  <li>SecondaryLibrary.py - specific methods are available in this file, which cannot be placed in the MainLibrary.py file</li>
  </ol>
  <p>There are old scripts which only imports the MainLibrary and does not import the SecondayLibrary file. Here, when these old scripts are called - instead of accessing the methods from the mainlibrary file, is it possible to access the methods from the secondaryLibrary file without changing anything in the scripts or MainLibrary file.</p>
  <p><strong>Example:</strong></p>
  <p>MainLibrary.py file:</p>
  <pre><code>class MainLibrary:
      def x(self, a =0, b=0, c= 0):
          &quot;&quot;&quot; Do some operation with these values&quot;&quot;&quot;
      def y(self, a=0,b=0,c=0):
      &quot;&quot;&quot;Do some operation with these values&quot;&quot;&quot;
      
  </code></pre>
  <p>SecondaryLibrary.py file</p>
  <pre><code>class SecondaryLibrary:
      def xy(self, a=0, b=0, c=0):
          &quot;&quot;&quot;Compute the value of C based on the values of a and b and then do some operation&quot;&quot;&quot;
  
      
  </code></pre>
  <p>&quot;The old scripts will recieve the values for paramters &quot;a and b&quot; and C will be always 0&quot;
  But, with the new requirements, i need to compute the value of C based on the values of a and b - all the computation part are handled in xy method&quot;</p>
  <p>Note: I dont have permission to edit the MainLibrary file or the Scripts, everything has to be handled in the SecondaryLibrary file</p>
  <p>Script:</p>
  <pre><code>from MainLibrary import *
  obj = MainLibrary()
  &quot;get the values of a and b&quot;
  obj.x(a,b)  
  Here when method X is called --&gt; i need to call method &quot;xy&quot; from the sceondaryLibrary file.
      
  </code></pre>