endless loop

Asked by Ju1+i-我.

before executing function a , there is a picture named b , but when it is executed , the picture b disappeared , causing an endless loop (actually , until today , function a has been operating well )

function a :

while True:
    if not exists(b):
        wait(2)
    else:
        break

could you please help on this ? thanks a lot

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ju1+i-我. (1ju2+i-a.) said :
#1

I changed the picture b into a path (such as : "C:\\rpaproject\\output\\APO_Screenshots\\b " ), but still doesn't work

Revision history for this message
Roman Podolyan (podolyan-roman) said :
#2

This code _must_ produce endless loop if picture b does not exist at the time of its execution. I don't know why man who wrote the code would want that, but they did.

What you want to happen here?

Revision history for this message
Ju1+i-我. (1ju2+i-a.) said :
#3

thanks .

before executing function a , there is a picture named b in path c , but when it is executed , the picture b disappeared from path c , so it caused an endless loop

function a :

while True:
    if not exists(b):
        wait(2)
    else:
        break

Revision history for this message
Ju1+i-我. (1ju2+i-a.) said :
#4

I use cmd to run several .py files , so i need to judge whether the previous step has been executed . If the execution is completed , picture b will appear in the screen , otherwise it will wait 2s

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.