I have this list:
list_vin = ['D03960','D03987','D04014']
This function which uses the list:
def lol():
pyautogui.click(699,60)
pyautogui.hotkey('command','f')
pyautogui.typewrite(list_vin[2])
pyautogui.press('enter')
time.sleep(0.5)
pyautogui.hotkey('command','p')
pyautogui.press('enter')
lol()
And this function to repeat the list:
def refresh():
schedule.every(int(1)).seconds.do(lol)
while 1:
schedule.run_pending()
time.sleep(1)
refresh()
How can I make it so that every time the function repeats a new item is used from the list? E.g. first time function runs it uses this D03960, second time the function runs it uses this D03987 in this line of the function pyautogui.typewrite(list_vin[2])
I am a beginner, don't be mad if I phrased the question incorrectly, hopefully, you understand it. Btw feel free to change the code entirely.
Thanks in advance.
question from:
https://stackoverflow.com/questions/65602004/add-new-number-from-a-list-every-time-a-function-is-repeated-python-3 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…