sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #48518
Re: [Question #673806]: NameError ( name "logout" is not defined) - strange?
Question #673806 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673806
RaiMan proposed the following answer:
Masuo's answer is correct: the function-def logout has to be moved to
the top.
The symptoms you tell about can only happen inside the IDE, where you
run the same script more than once.
The logout is referenced in an else branch. If this is not visited at
the first run, then the function-def will be collected at the end of the
script and will be defined for each subsequent run.
The reason behind: While in the IDE, you have only one interpreter
session, that remembers the names already defined.
Best practice: Make final tests of a script by running from commandline,
where a script is only run once with a new interpreter session every
time it is run.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.