title: NameError: global name 'myExample2' is not defined # modules
body: <p>Here is my <code>example.py</code> file:</p>
  
  <pre><code>from myimport import *
  def main():
      myimport2 = myimport(10)
      myimport2.myExample() 
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>And here is <code>myimport.py</code> file:</p>
  
  <pre><code>class myClass:
      def __init__(self, number):
          self.number = number
      def myExample(self):
          result = myExample2(self.number) - self.number
          print(result)
      def myExample2(num):
          return num*num
  </code></pre>
  
  <p>When I run <code>example.py</code> file, i have the following error:</p>
  
  <pre><code>NameError: global name 'myExample2' is not defined
  </code></pre>
  
  <p>How can I fix that?</p>