title: How to import a single function to my main.py in Python from another module?
body: <p>In my script I have a function inside a module which I wish to be able to use in my main module to prevent redundancy. This other module (not my main, let's call it <code>two.py</code>) contains several classes and to import a class for use in another module one would use</p>
  
  <pre><code>from someDirectory.two import ClassA
  </code></pre>
  
  <p>Which works fine for importing the entire class, but say I have a function <code>myFunction()</code> in a different class <code>ClassB</code> contained in the same <code>two.py</code> module, which I want to be able to use in my <code>main.py</code>.</p>
  
  <p>Is there a way which I can "grab" that function for use in my <code>main.py</code> or other modules, without having to import the entire class or redefine the same function?</p>