← Back to team overview

sikuli-driver team mailing list archive

[Question #259687]: UnicodeEncodeError when calling a script in some other script

 

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

I was facing an issue where I need to copy the text and compare. Now as I have overcome the issue, one another issue I am facing is while importing same script in another scripts. Below is my script. Can you please help me to resolve the issues as it raise "WHILE IMPORTING!! Non-ASCII character in file ' D: test.sikuli\test.py', but no encoding declared; see http://www.python.org/peps/pep-0263.html for details"

Script1: Test

from sikuli import*
import codecs

compareValue = "We built the new Hydra console just for you! We encourage you take a tour to check out the new look and functionality. If you’d like to continue using the old Hydra, click “Switch Back.”"

def testnow():
    getTitle = Region(find("1419429990021.png"))
    getTitle.highlight(2)
    getContent = Region(getTitle.x, getTitle.y+50, getTitle.w, getTitle.h)
    hover(getContent)
    for x in xrange(3):
        mouseDown(Button.LEFT)
        mouseUp()
    type("c", KEY_CTRL)
    gettext = Env.getClipboard().encode('utf-8')
    print "Text: ",gettext
    if gettext == compareValue:
        print "Pass"
    else:
        print "Fail"

testnow()

Script2: Test1

from sikuli import*
import codecs

import test
reload(test)

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