Settings not defined in imported Python script

Asked by Raymond

When I import a Python module, the Settings property isn't working

Main script:
import os
ini_path = os.path.dirname(getBundlePath())
if not ini_path in sys.path:
    sys.path.append(ini_path)

from Ini import *

Ini.py module:

Settings.MoveMouseDelay = 0.2

The following error shows up:

NameError: name 'Settings' is not defined

I'm not sure whether this is a namespace issue or a Sikuli module issue.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

imported scripts (each one!) generally need a

from sikuli.Sikuli import *

before the first usage of Sikuli features (but only if they use them)

see: http://sikuli.org/docx/globals.html#importing-other-sikuli-scripts-reuse-code-and-images

Can you help with this problem?

Provide an answer of your own, or ask Raymond for more information if necessary.

To post a message you must log in.