I'm trying to write a python program that works with threads. I'm using concurrent.futures to handle the threads. In the programm one thread should create an PDF-File. Because this task is lasting very long I want to create a thread to handle the creation. But after sometime I want to work with the pdf file again. Therefore, I have to be sure, that the previous thread is finished.
My question is, how can I check if my concurrent future thread is finished or how I can wait on its execution.
Code
if __name__ == '__main__' with concurrent.futures.ThreadPoolExecutor() as executor: document = executor.submit(createPDF, pdfValues) #working on something different .... #Here I want to work with the pdf file again, via a new thread #Therefore I want to make sure that the thread above is finished. with concurrent.futures.ThreadPoolExecutor() as executor: result = executor.submit(workWithPDF, values)