← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #232707]: Unable to import module & call method

 

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

RaiMan proposed the following answer:
BTW: if it is a start to setup some more complex scenario, this is how
it should be in Python:

# main.sikuli

import sub
reload(sub)
from sub import *

flexClient = r"https://12344/vsphere-client/#"; + Key.ENTER
username = "hello" + Key.ENTER
pwd = "hello" + Key.ENTER

# setup object with specific instance variables
chrome = Chrome(flexClient, username, pwd) 
chrome.login()

# sub.sikuli
from sikuli import *

class Chrome:
    # instance variables
    flexClient = None
    username = None
    pwd = None

    # auto called at object instantiation time
    def __init__(self, f, u, p): 
        self.flexClient = f
        self.username = u
        self.pwd = p

    def login(self):
    #do some stuff & log in to Chrome
        print self.flexClient, self.username, self.pwd
        return 0

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