문제

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

도움이 되었습니까?

해결책

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()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top