These 3 functions are working, but the last one needs to wait till the first and second are executed. I can use time.sleep()
, but I think this is not the right way. How do I fix it?
def convert_and_save(self):
self.open()
time.sleep(5)
self.convertThread.start()
time.sleep(5)
self.saveThread.start()
def convert_and_save(self):
self.open()
self.convertThread.start()
self.saveThread.start()
self.convertThread.join()
self.saveThread.join()
error: AttributeError: 'ConvertThread' object has no attribute 'join'
This works but suspendig GUI :(
def convert_and_save(self):
self.open()
self.convertThread.start()
while self.convertThread.isFinished() == False:
time.sleep(0.1)
self.saveThread.start()