This is part of a python program under windows environment. I am trying to do the following: from an html, I want to create a pdf and then open it:
#create the pdf os.system("start wkhtmltopdf.exe result.html %s%s" %(output_directory, pdf_document_name)) #open the current pdf os.system("start %s%s" %(output_directory, pdf_document_name))
The issue is that sometimes the script of creating the pdf is slower, so I get an error from the terminal saying that there is no file with such name.
I want to ask whether it's possible to call the pdf open only when the creation is successful and finished. I know how to do it by invoking a time.sleep() , but I think that's not too professional.
Many thanks,
D