I have a text file with a long list of names that I have to copy and paste into various fields in a separate program. I have converted all the names to a list, then have pyperclip copy the names to the clipboard. My solution to get to the next name is to have an empty input in the loop that will copy the next name, but I'd like for it to automatically copy the next name as soon as I paste the previous one. Is this possibly with pyperclip? Here is the code I have so far:
import sys
import pyperclip
with open(sys.argv[1]) as r:
namelist = r.read().splitlines()
r.close()
for name in namelist:
pyperclip.copy(name)
input('Press Enter for next name')
How can I make it so that it copies the next name in the list as soon as I paste the previous so I don't have to keep going back and forth between programs?