title: Sending progress value to progress bar in python
body: <p>In my game I have two modules, <strong>island.py</strong> which loads the islands into my game and the second module is <strong>gui.py</strong> which handles the gui widgets before game starting. My problem is how to send the progress values from the island.py module to the progress bar created in <strong>gui.py</strong> module <strong>EDIT: also with an instance of the loading screen to access the progress bar in it and change its value.</strong></p>
  
  <p><strong>In the module island.py</strong></p>
  
  <pre><code>def __iter__(self):
          total = float(len(self.ground_map))
          import game.gui
          for i in self.get_coordinates():
              yield i
              global count
              count+=1
              progress = (count/total) * 100 
              game.gui.Gui.set_progress(progress)
          global count
          count = 0
  </code></pre>
  
  <p><strong>In the module gui.py</strong></p>
  
  <pre><code>def show_loading_screen(self):
      self._switch_current_widget('loadingscreen', center=True, show=True) # Creates the loading screen and its associated widgets, except the progress bar.
  
  @staticmethod
  def set_progress(progress):
      # Now I have the progress values, and it will be updated automatically... how can I pass it to the progress bar widget?
      # I need to create the progress bar widget here, but to do that I need to have the self instance to give me the current screen that I will create the progress bar for **AND HERE IS THE PROBLEM!!**
      def update_loading_screen(progress):
          """updates the widget."""
          **self,current**.findChild(name="progressBar")._set_progress(progress)
      update_loading_screen(progress)
  </code></pre>
  
  <p>How I can make this update_loading_screen function?</p>