Multiline text input

Asked by Edmundo VN

Is there any way to input multiline text in sikuli?

The input() function discard new line characters.

What I want is to fill a screen with information, but I need to pass that information to sikuli, one way, would be passing multiline text, parse it using phyton and type it in the apropriate places.

Any suggestion about the easyest way to do this (input multiline text)?

Question information

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

put your stuff in a file and read it:

inp = open("somefile.txt")
lines = imp.readlines()
# now lines contains all lines as a list
inp.close()

for line in lines:
    text = line.strip() # get rid of new line
    print text
    # or do anything with text, that you want

or access each line individually:
text = lines[0].strip()

Revision history for this message
Edmundo VN (edmundo-vn) said :
#2

Thanks RaiMan, that solved my question.