I am developing one python project using gui with Qt support. faced such a problem:

 while True: res = self.file.load("file.txt", isList=False) self.log("Ожидаем ввод") print("Ожидаем ввод") if res: break else: self.log("Ждём") print("Ждём") time.sleep(5) 

The fact is that the print "We are waiting" and "We are waiting for input" is written to the console, but the guy dies tightly. Just hangs and that's it. What could be the problem?

Reported as a duplicate by Sergey Gornostaev , 0xdb , jfs python Jun 22 '18 at 6:54 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Sorry, what did you want? Twist the cycle (from which, as I understand it, there is no way out, and you don’t transfer control to Guy. How can he do something without the help of a processor? - alexlz
  • more interesting ... what does "transfer not transmitting" mean? Do you need to update it in the body of the cycle, or is there some other way? - Izengardjke
  • one
    Such things need to be run in the child thread. - AlexDenisov
  • @ 1101_debian Well, if several threads, then yes. @izengardjke I don’t know qt, but in other geyas there are usually similar calls to handle accumulated events. - alexlz

0