I am developing a software as part of my work, as soon as I make a call to the API to fetch data the GUI freezes, at first I understood the problem and transferred the functions to threads, the problem is that once I used the join() function the app froze again. What I would like is to wait at the same point in the function until the threads end and continue from the same point in the function, is there any way to do this in Python?
threads = []
def call_api(self, query, index, return_dict):
thread = threading.Thread( target=self.get_data, args=(query, index, return_dict))
self.threads.append(thread)
thread.start()
def get_all_tickets(self, platform):
if platform == 'All':
self.call_api(query1, 0, return_dict)
self.call_api(query2, 1, return_dict)
for thread in self.threads:
thread.join()
# The app freezes here
# Is there a way to wait at this point asynchronously until the processes are complete
and continue from that point without the GUI freezing?