← Back to team overview

sikuli-driver team mailing list archive

[Question #676323]: How to type from lines in a text file, in sequence, and loop script until text file is exhausted?

 

New question #676323 on Sikuli:
https://answers.launchpad.net/sikuli/+question/676323

Forgive me if this is a simple question, but I only know a little about programming, so I'm hoping someone can help me out. Here's what I'm trying to do:

I have 2 different text files (.txt) The first file contains a list of names, like this:

John
Stacy
Jessica

The second text file contains a list of animals, like this:

Dog
Cat
Yeti

My Sikuli script is as follows:

type("John")
paste("Dog")

Now, with this in mind, instead of the script simply typing only John and Dog and then stopping, how do I have it loop, or repeat, and each time it does, take the next entry in the text file in the place of "John" until the list has been exhausted AND select a REMAINING animal from the second list RANDOMLY, until all have been used?

So, in short, how do I program Sikuli to pull text from lists until exhaustion, both "in sequence" and "randomly?"

Any help anyone can provide, with a code example I could study to learn how to do this, would be truly, sincerely appreciated. Again, I'm not much of a programmer :(

Pixby

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.