← Back to team overview

sikuli-driver team mailing list archive

[Question #187432]: User Input Choices

 

New question #187432 on Sikuli:
https://answers.launchpad.net/sikuli/+question/187432

I have scripts that can still continue if one section fails.  And so, have added code like this to give the user a choice of exiting or continuing with the balance of the script:

if not r1.exists(imgLM1, 0):
    name = input("Target not found", "Cancel to exit script   OK to continue")
    if name == None: # Cancel button
        exit()
    else: # OK button with any text entered in input field
        <code affected by the failure>
<balance of script continues from here>

Is there a better or more elegant way to handle this? 


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.