← Back to team overview

sikuli-driver team mailing list archive

[Question #197440]: error occurs when importing the files in the same directory

 

New question #197440 on Sikuli:
https://answers.launchpad.net/sikuli/+question/197440

Hi,

I having two files in the same directory. i want to import a file to another. so i have followed your instrunction which is given in the Sikuli documentation .
 but one error is occuring when importing a file. The error is
 
[error] Error message: Traceback (most recent call last):
 File "E:\DOCUME~1\oramu\LOCALS~1\Temp\sikuli-tmp3479052429520681513.py", line 7, in 
 Function.test(str);
 File "D:\Test\Function.sikuli\Function.py", line 5, in test
 click("1336642874695.png")
NameError: global name 'click' is not defined


my source code in Function.sikuli is

from sikuli.sikuli import* 
def test(n):
 a=img5
 for n in range (0,8):
    click("img1")
     wait(10)
    click("img2")
    click("img3')
    wait(15)
    click("img4")
    click("img5")


source code for imported file has

import os
myScriptPath = "D:\\function\\Function"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
import Function
find("1337158339156.png")
Function.test(str)


please give your suggestion for this

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