← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #252004]: How to use function of one class in another class

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
when using
import some_module

then you have to qualify the contained members with the module name.

some_module.some_member

since in your case the functions are not on level null, but inside of a class, you have to use this to call e.g. blank_number:
phonevalidation.numberediting().blank_number()

My impression:
The class level in your implementation is of no use, since your intention is, to just use functions in other modules.
So just define the functions on the level null without a class, then it would simply be:
phonevalidation.blank_number()

… and if you implement a naming convention, so the member names
integrate into the main namespace without any overlapping, then it is
even easier:

from phone validation import * # reveals the level 0 member names in this namespace
blank_number() # so they can be used without qualification

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