← Back to team overview

sikuli-driver team mailing list archive

[Question #193835]: exit() always returns '1' on Sikuli

 

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

Hello all,

I've been working with Sikuli for some weeks now. Right now I am trying to use the exit() function, but I have not found a way. I've written a simple script on Sikuli, and even though I've typed exit(0) I get a return code of 1 when it runs.

Here's the code:

*******************************************************************************************
import sys
sys.path.append('C:\Users\Developer\Documents\modules')
import login, misc, traceback
from datetime import datetime

now = datetime.now().strftime("%m%d%y-%H%M")

App = App('C:\Program Files\Internet Explorer\iexplore.exe https://a75qa.aplicor.net/a7')
App.open()
try:
    login.login()
    wait(20)
    if (exists("Workspace.png", 10)):
       click("red_cross.png")
    click("O.png")
    wait(5) 
    misc.shift_del()
    wait(5)
    type('name1')
    wait(5)
    click("red_cross.png")
    if(exists("already_name.png", 10)):
        click("ok.png")
    wait(10)
    login.logout()
    wait(10)
    exit(0)
    
    
except Exception:
    exc_type, exc_value, exc_traceback = sys.exc_info()
    traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2)
    exit(1)
except:
    exc_type, exc_value, exc_traceback = sys.exc_info()
    traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2)
    exit(1)
*******************************************************************************************

What I get on the Sikuli when I run this is:
[info] Exited with code 1

I've noticed that if I run this on the command line, I get an additional message, but at the end I still get a 1 as exit code.

Traceback (most recent call last):
   File "C:\users\Developer\Documents\modules\workspace.sikuli\workspace.py", line 27 in (module)
         exit(0)
      File "C:\Program Files\Sikuli X\sikuli-script.jat\Lib\sikuli\Sikuli.py", line 190, in exit
          sys.exit(code)
Syste,Exit:0
[info] Exited with code 1

Could anybody give me some help on this??? I would really appreciate it.

Thanks!!!



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