'Region' is not defined when attempting to import
I'm attempting to define all of my regions/images as variables inside of a separate file (definedregions
I've tried importing it using the 4 lines below taken from the docs.
import os
myPath = os.path.
if not myPath in sys.path: sys.path.
import definedregions
This still gives the region not defined error, I've tried moving my definedregions.
I have the feeling I'm overlooking something basic but I'm not sure :P
I've tried different scripts from similar questions but nothing seems to work :(
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Sikuli Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ethan Perry
- Solved:
- 2020-09-25
- Last query:
- 2020-09-25
- Last reply:
Ethan Perry (1m4) said : | #1 |
error message:
[error] script [ Testing ] stopped with error in line 5
[error] NameError ( !!WHILE IMPORTING!! name 'Region' is not defined )
[error] --- Traceback --- error source first
line: module ( function ) statement
1: definedregions ( <module> ) REGtaskbar = Region(
5: main ( <module> ) import definedregions
[error] --- Traceback --- end --------------
Ethan Perry (1m4) said : | #2 |
After putting "from sikuli.Sikuli import *" at the beginning of my definedregions script, it doesn't have any issues importing but later when it gets to using a region (called REGtaskbar) it says:
[error] script [ Testing ] stopped with error in line 10
[error] NameError ( name 'REGtaskbar' is not defined )
[error] --- Traceback --- error source first
line: module ( function ) statement
10: main ( <module> ) REGtaskbar.
[error] --- Traceback --- end --------------
Ethan Perry (1m4) said : | #4 |
It appears the extra definedregions.