title: After splitting my code into one file per class - class can't see one "global class"
body: <p>My code consists of few classes - some are UI Widgets, some are pure functional and one is to store some global settings (settings from the MainWindow which I am accessing from other Widgets).</p>
  
  <p>I create the "global settings-class" right along with the Mainwindow, everything else is created by the MainWindow or its children. - This works as long as the whole code is in the same file.</p>
  
  <p>To avoid silly scrolling I split up the code into one file per class. The creation of the "global settings-class" remains in the file with the MainWindow.</p>
  
  <p>But now the Children of MainWindow can't access/see the "global settings-class" anymore...</p>
  
  <p>The files are all in the same folder and I tried <code>import xxx</code>, <code>from xxx import *</code> and <code>import xxx as x</code>.</p>
  
  <p>By commenting out all "option"-related code (and losing this functionality) it seems to work.</p>
  
  <p>I just don't see why it shouldn't work after splitting up the whole thing.</p>
  
  <p>Edit - details:</p>
  
  <p>file 1:</p>
  
  <pre><code>class MainWindow(QMainWindow):
      def __init__(self):
          QMainWindow.__init__(self)
  
          ... # A MenuBar with checkable Items, QAction calls a function which sets the option in o_option instance
  
      def startWidgetXYZ(self):
          self.setWindowTitle(...)
          self.initAllChecks()
          xyz = XYZ(file, topic, self)
          self.setCentralWidget(xyz)
  
  o_options = MenuBarOptions()   # this is the global
  app = QApplication(sys.argv)
  m_window = MainWindow()
  m_window.show()
  sys.exit(app.exec_())
  </code></pre>
  
  <p>file2:</p>
  
  <pre><code>class XYZ(QWidget):
      def __init__(self, file, topic, parent=None):
          QWidget.__init__(self, parent)
  
          self.k_korpus = Korpus(file, topic)   # the class Korpus will load/save data from/to XML-files
  </code></pre>
  
  <p>file3:</p>
  
  <pre><code>class Korpus(object):
      def __init__(self, file, topic):
  
          self.file = file
          self.level = level
          self.patienceChecked = o_options.isOption123Checked()  # NameError: global name 'o_options' is not defined - (but no error if code is in one file)
  </code></pre>