← Back to team overview

sikuli-driver team mailing list archive

[Question #667211]: How to call a class method in Sikuli?

 

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

I  have been using Sikuli for about two years now, and I really think it is a Godsend (if you believe in that kind of thing). In some parts of my job I need to process large sets of data into a web application and I am using Sikuli to do that for me. I have familiarized myself with the concept of loops variables, functions and importing other Sikuli scripts, and now I feel comfortable enough to take what is in my mind the next step. 

So now, I am trying to get the concept of classes to work in Sikuli but when I use the snippet of code I placed underneath nothing happens. I am using a simple text editor to try to get Sikuli to type the text and hit Enter. 

class Test:
    def Type(self):
        type('this is just a silly example')
        type(Key.ENTER)
        wait(0.1)
        
Example = Test()

for step in range (5):
    Example.Type


I can easily get this to work when not placing the function within a class.I did search for other answers en checked the manual at 'read the docs' but I couldn't find a satisfying answer. 

Should you have any questions, feel free to ask. 




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