← Back to team overview

sikuli-driver team mailing list archive

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

 

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

I have a function below:

def test():
    var1="ONUR"
    popup("MyFunction PopUp")
    #print("Sub End1")
    #return deneme
    print("Sub End2")

a=????

print("a")

What should I write instead of ???? to get var1 variable's value without return method. Note: when I run the code I do not want to see popup. I only want to print var1 value.

I tried class definition still I am seing popup :((

class Test:
    var1 = "ONUR"
    popup("This is POPUP")
    def f(self):
        return 'hello world'

a=Test.var1
print(a)

Above code prints "ONUR"

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