← Back to team overview

sikuli-driver team mailing list archive

[Question #171845]: I cant count!!

 

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

I'm just looking for an answer on how to count with a passable variable. 
####################### This always returns 0 inside the loop ##
a = 0
def addOne(a):
    a +=1
while exists("1316568059480.png"): ## just made this to control the loop.
    addOne(a)
    popup(str(a))  ## need this to count up by one each click.
##################################################

########## This works as a counter but is useless##############
a = 0  
while exists("1316568059480.png"): ## just made this to control the loop.
    a +=1 
    popup(str(a))  ## need this to count up by one each click.
##################################################

#### This works just the same as the first example ##############
def program():
        a = 0 
    def countOne(a):
        a +=1
    while exists("1316568059480.png"): ## just made this to control the loop.
        countOne(a) 
        popup(str(a))  ## need this to count up by one each click.
program()
#################################################


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