Using Variables From External File

Asked by Kevin Anderson

I have a list of variables that need to be imported into text boxes. Is there a way to load these values into the script so I do not need to have custom scripts for each specific task.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

not familiar with python: http://docs.python.org/index.html

read a file line by line:

f = open("... filename ...")

while 1:
   l = f.readline()
   if l: # something there?
      pass # here your actions
   else
      break # stop loop if empty

f.close

Python uses indentation to show where blocks start and end.

Can you help with this problem?

Provide an answer of your own, or ask Kevin Anderson for more information if necessary.

To post a message you must log in.