In a program I am writing, I have a small problem. I would like to be able to know when an element has been created but do not have access to the element's library. The library provides a function that returns True or False when it is finished and ready to continue. Currently I am using a busy wait structure such as:
def Waiting_Procedure():
finished = false
while not finished:
time.sleep(1)
if library_function_returns_true:
finished = true
This works fine for now, but I'd like to know if there is a better/simpler/elegant way to accomplish this in Python. Also, if the library never returns true, it would spin forever at 1 second intervals, which would not be ideal.
Thanks!