Sikuli with Lettuce

Asked by YongJianYan

1, I have set sites in "C:\Users\Administrator\AppData\Roaming\Sikulix\SikulixRepo\Lib\site-packages\sites.txt"
    sites.txt content :
    C:\Python27\Lib\site-packages
    but when I code it as :
    # -*- coding: utf-8 -*-
from lettuce import *

@step('I have the number (\d+)')
def have_the_number(step, number):
    world.number = int(number)
 I met
[error] script [ TestLettuce ] stopped with error in line 2
[error] ImportError ( No module named lettuce )

2,When I run Lettuce as BDD framework, How to run from SikuliX IDE or Can I code a python code which can import sikuli?
I need a example Thank you.

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

to activate the SikuliX features in any Jython script, that is not run by the SikuliX-IDE, you have to add
from sikuli import *

near the top of the script (before any other imports).

If you run a script from IDE neither
# -*- coding: utf-8 -*-

nor
from sikuli import *

is needed in the main script, but only in scripts, that are imported (if relevant).

... and the feature to add the sites.txt contained paths to sys.path is a SikuliX feature.

Can you help with this problem?

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

To post a message you must log in.