Importing username and password from list

Asked by Justin on 2019-05-21

Hello, I was interested to see it is possible to import a list of usernames and passwords into Sikuli?

I have a list of usernames and passwords which I need to login and checkboxes across all accounts. I wanted this task to be automated, however, I cannot seem to figure out how to add accounts.

All of the usernames and passwords are sorted as follows -

username1:password1
username2:password2
etc.

Thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-05-22
Last reply:
2019-05-23
RaiMan (raimund-hocke) said : #1

how and where are these values stored?

as a file?

Justin (justlols2) said : #2

Correct, these are all stored in C:\file.txt and the format is as follows in the original post.

RaiMan (raimund-hocke) said : #3

something like that (plain Python scripting - has nothing to do with SikuliX)

myFile = open("c:\\file.txt')
users = {} # a store
for line in myFile.readlines():
    line = line.strip() # remove surrounding whitespace
    (user, password) = line.split(":") # get the 2 elements
    users[user] = password # add to store

for user in users.keys():
    print "user: %s has password: %s" % (user, users[user])

Can you help with this problem?

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

To post a message you must log in.