我正在使用Python 2.7,並且我已經從here安裝了sikuli_cpython。sikuli中的org.sikuli.api.ScreenRegion錯誤是什麼意思?
我有一個簡單的腳本:
from sikuli.sikuli import *
symbol_image ='symbol.jpg'
t = find(symbol_image)
print t
click(t)
當我運行它,我得到以下錯誤信息:
File "C:\Projects\sikuli1.py", line 112, in <module>
click(t)
File "C:\Python27\lib\site-packages\sikuli-0.1-py2.7.egg\sikuli\sikuli.py", line 61, in click
loc = Pattern(target_string).getLocation()
File "C:\Python27\lib\site-packages\sikuli-0.1-py2.7.egg\sikuli\sikuli.py", line 139, in getLocation
t = self.getTarget()
File "C:\Python27\lib\site-packages\sikuli-0.1-py2.7.egg\sikuli\sikuli.py", line 135, in getTarget
return self._get_target_from_string(self.target_string)
File "C:\Python27\lib\site-packages\sikuli-0.1-py2.7.egg\sikuli\sikuli.py", line 148, in _get_target_from_string
target_file_loc = self._find_local_file(target_string)
File "C:\Python27\lib\site-packages\sikuli-0.1-py2.7.egg\sikuli\sikuli.py", line 162, in _find_local_file
poss_relative_path = os.path.join(os.getcwd(), target_string)
File "C:\Python27\lib\ntpath.py", line 73, in join
elif isabs(b):
File "C:\Python27\lib\ntpath.py", line 57, in isabs
s = splitdrive(s)[1]
File "C:\Python27\lib\ntpath.py", line 125, in splitdrive
if p[1:2] == ':':
TypeError: 'org.sikuli.api.ScreenRegion' object has no attribute '__getitem__'
我知道sikuli是在Jython中使用。我已經使用sikuli ide,並且已經安裝了jython 2.5.3。儘管使用jython easy_install sikuli會遇到問題。