title: Python global object variable
body: <p>I want to make use on an object that has been instantinated inside of a class from a standalone module. I am trying to do this by makeing the object reference global. I think I want to make use of the current object and not create a new one.</p>
  
  <p>Assume I have this code in a module file</p>
  
  <pre><code>import moduleFile
  class A():
      def checkAdmin(self):
          global adminMenu
          adminMenu = SRMadminMenu()
  
  class SRMadminMenu()
      def createAdminMenu(self):
          pass
          ####Put code to create menu here####
  
      def createSubMenu(self,MenuText):
          pass
          ####Create a submenu with MenuText####
  </code></pre>
  
  <p>In moduleFile.py I have this code</p>
  
  <pre><code>def moduleFile_Admin_Menu():
      global adminMenu
      adminMenu.createSubMenu("Module Administration")
  </code></pre>
  
  <p>the code in moduleFile.py gives me the following error.</p>
  
  <pre><code>NameError: global name 'adminMenu' is not defined
  </code></pre>