Please, I need help with a looping through a list

Asked by chy

Hi! So I have a long script that logs in to accounts and does some actions then logs out, then repeats. I made a list of the logins that I want the script to loop through, but ONE BY ONE as the script starts over. So for example it looks kinda like this:

while True: #to loop infinitely I guess? sorry I'm still learning
   click ("blah.png")
   logins = ['<email address hidden>', '<email address hidden>', etc]
   for x in logins:
      type("%s" %x + Key.TAB)
      type("pass" + Key.ENTER)
   #after this is all just the actions I need to be done
   #the script will then log out of the account but I want it to go the NEXT email (<email address hidden>) after going through the first one (<email address hidden>)

I'm probably doing this in a very inefficient way but what happens is that all the emails are typed into the email box at once. I've tried breaking the loop but then it will start over to the first email when the whole script loops again. If anyone could please help me out with this, I'd really really appreciate it! Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
chy
Solved:
Last query:
Last reply:
Revision history for this message
chy (bernicefe) said :
#1

Never mind, I figured it out!