← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #446242]: Sikuli cannot run if I add a def()

 

Question #446242 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/446242

Description changed to:
I tried a script,

# content of script1.sikuli
popup("hello, I am script1")

in this way, message can be shown.

but if I add a def(), like this:
# content of script1.sikuli
def popup():
    popup("hello, I am script1")

sikuli cannot run, and there is not any error message.

how can solve this issue?






=========================================
I have tried in another way:

# content of script2.sikuli
def popup():
    popup("hello, I am script2")
script2.popup()


this time, it gave me a error message:

[error] script [ script2 ] stopped with error in line 4
[error] TypeError ( popup() takes no arguments (1 given) )
[error] --- Traceback --- error source first line: module ( function ) statement 4: script2 ( popup ) popup("hello, I am script2")
[error] --- Traceback --- end --------------

I wonder how to fix this

Thanks for your help:)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.