sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #19336
Re: [Question #232707]: Unable to import module & call method
Question #232707 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232707
Status: Open => Answered
RaiMan proposed the following answer:
@Eugene
It is Python.
def()'s in classes (object functions) are defined with a reference to the object as first parameter (usually self is used), but called without this first parameter.
So what she is complaining is valid ;-)
@Jennifer
this worked for me
# main.sikuli
import sub
reload(sub)
from sub import *
chromeObj = Chrome()
chromeObj.login(Chrome.flexClient, Chrome.username, Chrome.pwd)
# sub.sikuli
from sikuli import *
class Chrome:
######### Variables ########
flexClient = r"https://12344/vsphere-client/#" + Key.ENTER
username = "hello" + Key.ENTER
pwd = "hello" + Key.ENTER
############################
def login(self, flexClient, username, pwd):
#do some stuff & log in to Chrome
print flexClient, username, pwd
return 0
--- and produced:
https://12344/vsphere-client/#
hello
hello
[info] Exit code: 0
I ran it in IDE and both .sikuli are in same folder
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.