SikuliX起動直後のインポート済みモジュールは下記で確認できました。
Excel操作用のモジュール xlrd
や xlwt
は個別に import
して使うことが可能ですが、
実態がどこにあるか確認してみると…
sample.sikuli
import xlrd
print(xlrd.__file__)
# 実行結果↓
D:\SikuliX\sikulixide-2.0.5-win.jar\Lib\xlrd\__init__.py
どうやら sikulixide-2.0.5-win.jar
内の Lib
フォルダに格納されているようです。
念のため Path がどこに通っているか、sys.path
も見てみると…
sample.sikuli
for i in sys.path: print(i)
# 実行結果↓
D:\SikuliX\sample.sikuli
%APPDATA%\Sikulix\Lib\site-packages
%APPDATA%\Sikulix\Lib
D:\SikuliX\Lib
D:\SikuliX\sikulixide-2.0.5-win.jar\Lib
__classpath__
__pyclasspath__/
sikulixide-2.0.5-win.jar\Lib
にあるモジュールであれば読み込むことができるようです。
Ver.2.0.5 のモジュールを確認したところ、以下が利用可能であることがわかりました。
(モジュール名) | from sikuli import * | import (モジュール名) |
---|---|---|
StringIO | 〇 | 〇 |
UserDict | 〇 | 〇 |
__builtin__ | 〇 | |
__future__ | 〇 | 〇 |
__main__ | 〇 | |
_abcoll | 〇 | 〇 |
_bytecodetools | 〇 | |
_codecs | 〇 | |
_collections | 〇 | |
_functools | 〇 | |
_imp | 〇 | |
_jythonlib | 〇 | |
_sre | 〇 | |
_weakrefset | 〇 | 〇 |
abc | 〇 | 〇 |
array | 〇 | |
codecs | 〇 | 〇 |
collections | 〇 | 〇 |
com | 〇 | |
com.google | 〇 | |
com.google.common | 〇 | |
com.google.common.cache | 〇 | |
com.google.common.collect | 〇 | |
copy_reg | 〇 | 〇 |
dis | 〇 | 〇 |
encodings | 〇 | 〇 |
encodings._java | 〇 | |
encodings.aliases | 〇 | |
encodings.aliases._java | 〇 | |
encodings.utf_8 | 〇 | |
errno | 〇 | |
exceptions | 〇 | |
functools | 〇 | 〇 |
genericpath | 〇 | 〇 |
heapq | 〇 | 〇 |
imp | 〇 | 〇 |
inspect | 〇 | 〇 |
itertools | 〇 | |
java | 〇 | |
java.lang | 〇 | |
java.nio | 〇 | |
java.nio.charset | 〇 | |
java.util | 〇 | |
java.util.Collections | 〇 | |
jythonlib | 〇 | 〇 |
keyword | 〇 | 〇 |
linecache | 〇 | 〇 |
nt | 〇 | |
ntpath | 〇 | 〇 |
opcode | 〇 | 〇 |
operator | 〇 | |
org | 〇 | |
org.python | 〇 | |
org.python.core | 〇 | |
org.sikuli | 〇 | |
org.sikuli.android | 〇 | |
org.sikuli.android.ADBScreen | 〇 | |
org.sikuli.basics | 〇 | |
org.sikuli.basics.Settings | 〇 | |
org.sikuli.script | 〇 | |
org.sikuli.script.App | 〇 | |
org.sikuli.script.Button | 〇 | |
org.sikuli.script.Constants | 〇 | |
org.sikuli.script.FindFailed | 〇 | |
org.sikuli.script.FindFailedResponse | 〇 | |
org.sikuli.script.Finder | 〇 | |
org.sikuli.script.Image | 〇 | |
org.sikuli.script.KeyModifier | 〇 | |
org.sikuli.script.Location | 〇 | |
org.sikuli.scr | 〇 | |
ipt.OCR | 〇 | |
org.sikuli.script.Offset | 〇 | |
org.sikuli.script.Region | 〇 | |
org.sikuli.script.SX | 〇 | |
org.sikuli.script.Screen | 〇 | |
org.sikuli.script.SikulixForJython | 〇 | |
org.sikuli.script.TextRecognizer | 〇 | |
org.sikuli.script.compare | 〇 | |
org.sikuli.script.runnerSupport | 〇 | |
org.sikuli.script.runnerSupport.JythonSupport | 〇 | |
org.sikuli.script.support | 〇 | |
org.sikuli.script.support.RunTime | 〇 | |
org.sikuli.script.support.Runner | 〇 | |
os | 〇 | 〇 |
os.path | 〇 | |
re | 〇 | 〇 |
sikuli | 〇 | |
sikuli.Env | 〇 | |
sikuli.Region | 〇 | |
sikuli.Sikuli | 〇 | |
sikuli.SikuliImporter | 〇 | |
site | 〇 | 〇 |
sre_compile | 〇 | 〇 |
sre_constants | 〇 | 〇 |
sre_parse | 〇 | 〇 |
stat | 〇 | 〇 |
string | 〇 | 〇 |
sys | 〇 | |
sysconfig | 〇 | 〇 |
thread | 〇 | |
time | 〇 | |
token | 〇 | 〇 |
tokenize | 〇 | 〇 |
traceback | 〇 | 〇 |
types | 〇 | 〇 |
warnings | 〇 | 〇 |
_fix_jython_setuptools_osx | 〇 | |
_fsum | 〇 | |
_google_ipaddr_r234 | 〇 | |
_io | 〇 | |
_LWPCookieJar | 〇 | |
_MozillaCookieJar | 〇 | |
_pyio | 〇 | |
_rawffi | 〇 | |
_socket | 〇 | |
_sslcerts | 〇 | |
_strptime | 〇 | |
_threading_local | 〇 | |
aifc | 〇 | |
anydbm | 〇 | |
argparse | 〇 | |
ast | 〇 | |
asynchat | 〇 | |
asyncore | 〇 | |
atexit | 〇 | |
base64 | 〇 | |
BaseHTTPServer | 〇 | |
bdb | 〇 | |
binhex | 〇 | |
bisect | 〇 | |
calendar | 〇 | |
cgi | 〇 | |
CGIHTTPServer | 〇 | |
cgitb | 〇 | |
chunk | 〇 | |
cmd | 〇 | |
code | 〇 | |
codeop | 〇 | |
colorsys | 〇 | |
commands | 〇 | |
compileall | 〇 | |
compiler | 〇 | |
ConfigParser | 〇 | |
contextlib | 〇 | |
Cookie | 〇 | |
cookielib | 〇 | |
copy | 〇 | |
crypt | 〇 | |
csv | 〇 | |
ctypes | 〇 | |
datetime | 〇 | |
dbexts | 〇 | |
decimal | 〇 | |
difflib | 〇 | |
dircache | 〇 | |
distutils | 〇 | |
doctest | 〇 | |
DocXMLRPCServer | 〇 | |
dumbdbm | 〇 | |
dummy_thread | 〇 | |
dummy_threading | 〇 | |
〇 | ||
ensurepip | 〇 | |
filecmp | 〇 | |
fileinput | 〇 | |
fnmatch | 〇 | |
formatter | 〇 | |
fpformat | 〇 | |
fractions | 〇 | |
ftplib | 〇 | |
future_builtins | 〇 | |
getopt | 〇 | |
getpass | 〇 | |
gettext | 〇 | |
glob | 〇 | |
grp | 〇 | |
gzip | 〇 | |
hashlib | 〇 | |
hmac | 〇 | |
htmlentitydefs | 〇 | |
htmllib | 〇 | |
HTMLParser | 〇 | |
httplib | 〇 | |
ihooks | 〇 | |
imaplib | 〇 | |
imghdr | 〇 | |
importlib | 〇 | |
io | 〇 | |
isql | 〇 | |
javapath | 〇 | |
javashell | 〇 | |
json | 〇 | |
lib2to3 | 〇 | |
locale | 〇 | |
logging | 〇 | |
macpath | 〇 | |
macurl2path | 〇 | |
mailbox | 〇 | |
mailcap | 〇 | |
markupbase | 〇 | |
marshal | 〇 | |
md5 | 〇 | |
mhlib | 〇 | |
mimetools | 〇 | |
mimetypes | 〇 | |
MimeWriter | 〇 | |
mimify | 〇 | |
modjy | 〇 | |
multifile | 〇 | |
mutex | 〇 | |
netrc | 〇 | |
new | 〇 | |
nntplib | 〇 | |
nturl2path | 〇 | |
numbers | 〇 | |
optparse | 〇 | |
pawt | 〇 | |
pdb | 〇 | |
pickle | 〇 | |
pickletools | 〇 | |
pipes | 〇 | |
pkgutil | 〇 | |
platform | 〇 | |
plistlib | 〇 | |
popen2 | 〇 | |
poplib | 〇 | |
posixfile | 〇 | |
posixpath | 〇 | |
pprint | 〇 | |
profile | 〇 | |
pstats | 〇 | |
pty | 〇 | |
pwd | 〇 | |
py_compile | 〇 | |
pycimport | 〇 | |
pyclbr | 〇 | |
pydoc | 〇 | |
pydoc_data | 〇 | |
pyexpat | 〇 | |
Queue | 〇 | |
quopri | 〇 | |
random | 〇 | |
readline | 〇 | |
repr | 〇 | |
rfc822 | 〇 | |
rlcompleter | 〇 | |
robotparser | 〇 | |
runpy | 〇 | |
sched | 〇 | |
select | 〇 | |
sets | 〇 | |
sgmllib | 〇 | |
sha | 〇 | |
shelve | 〇 | |
shlex | 〇 | |
shutil | 〇 | |
signal | 〇 | |
SimpleHTTPServer | 〇 | |
SimpleXMLRPCServer | 〇 | |
smtpd | 〇 | |
smtplib | 〇 | |
sndhdr | 〇 | |
socket | 〇 | |
SocketServer | 〇 | |
sre | 〇 | |
ssl | 〇 | |
subprocess | 〇 | |
symbol | 〇 | |
tabnanny | 〇 | |
tarfile | 〇 | |
telnetlib | 〇 | |
tempfile | 〇 | |
textwrap | 〇 | |
this | 〇 | |
threading | 〇 | |
timeit | 〇 | |
trace | 〇 | |
tty | 〇 | |
unicodedata | 〇 | |
unittest | 〇 | |
urllib | 〇 | |
urllib2 | 〇 | |
urlparse | 〇 | |
user | 〇 | |
UserList | 〇 | |
UserString | 〇 | |
uu | 〇 | |
uuid | 〇 | |
weakref | 〇 | |
webbrowser | 〇 | |
whichdb | 〇 | |
wsgiref | 〇 | |
xdrlib | 〇 | |
xml | 〇 | |
xmllib | 〇 | |
xmlrpclib | 〇 | |
zipfile | 〇 | |
zlib | 〇 |
email
や smtplib
があるので、自動実行の完了後にメールを送信するようなシナリオも書けそうです。
気になるのは、SikuliX は CV2 を利用した画像認識でありながら、Python のcv2
は同梱されていませんでした。
「スクリーンショットを撮った画像をプログラム内で加工~」のようなことを考えましたが、Pythonではなく Javaのモジュールorg\opencv\*
が使用されているようです。
この辺は現在研究中です。