← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #210973]: Sikuli code organization / code reuse

 

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

    Status: Answered => Solved

David confirmed that the question is solved:
>>>this gives an error in C-Python too, because you mean the class name
sub, which is not known in the current namespace (would only be, if you
would use <from sub import *>.

>>> correct usage in this case:
>>> sub.sub().doSomething()


Ah, my mistake. Doh. I forgot that when you want to instantiate an object you need to reference the module. IE:

s = Sub() #this is trying to instantiate an object from a class called Sub in the current module
s = sub.Sub() #this is instantiating an object from a class called Sub in the sub module.

So that resolves the import problem.


Thank you for all your help. I learned lots. <3 :D

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