i use threading.semaphore in my code and i wonder if there is way i can use code like This
if(sema.acquire()!=True):
#do Somthing
i want to use this piece of code in loop so i need to get if semaphore is taken or it's released or use code like this in my code
if(sema.get_value!=1):
#do something
i read this doc but i can't find my answer https://docs.python.org/3/library/threading.html
!=; useif not sema.acquire()instead.