← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #182558]: How access a variable in a function directly?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- def()
This is not possible with a function, since a function has to be run to assign values to variables (so the popup will always be processed). var1 would be accessible outside, when declared as global inside the def():

def test():
    global var1
    var1="ONUR"

test()
print var1

--- class
when using a class on the right side, its code is evaluated (otherwise var1 could not have its value ;-)
so the popup() is processed too, since it is on the class level and not packed in a def().

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