pythonwxglade

output statictext while processing python


I have written code to perform a function that could take a while to perform and I would like there to be output to a text box. at the moment all the intermediate output message all come at the end

def main():
  self.progress_txt.AppendText("Processing")
  #do something
  self.progress_txt.AppendText("Processing2")
  #do something else
  self.progress_txt.AppendText("Finished")

is there a way i could get the output messages outputed while the process is still running


Solution

  • Thanks to Oliver I was able to sort it

    def main():
      self.progress_txt.AppendText("Processing")
      self.progress_txt.Update()
      #do something
      self.progress_txt.AppendText("Processing2")
      self.progress_txt.Update()
      #do something else
      self.progress_txt.AppendText("Finished")
      self.progress_txt.Update()