← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #254687]: Image Dictionary Help

 

Question #254687 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/254687

    Status: Needs information => Answered

RaiMan proposed the following answer:
ok, seems to be really a dictionary, that you have in
puttydictionary.sikuli

1. you have to name the dictionary, that you want to read from:

someDict['ipaddress']

this returns the value (I guess image file name) in dictionary someDict
that is defined in puttydictionary.sikuli

2. you have to import your puttydictionary.sikuli to get access to the
contained elements

import puttydictionary
images = puttydictionary. someDict # see comment
openApp ('C:\Users\carrier\Documents\putty.exe')
# find (['ipaddress']) # not needed see comment
click (images['ipaddress'])
FGTIP = input('what is the IP address of the FGT? ')
type ('172.25.188.188')
# find (['Open'])
click (images['Open'])

comments:
--- in the main script
from sikuli import *
is not needed (done internally anyways)

but it is mandatory in imported scripts (putty dictionary.sikuli)

--- puttydictionary. someDict
since I do not know your puttydictionary. sikuli, I do not know the name of the dictionary.

--- # find (['Open'])
not needed, since the following click internally does a find anyway

One more thing:
for what you are doing, using a dictionary is far beyond the need.
Try to understand the concept In my comment #1.

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