I have a list named final
and I want to copy it to the clipboard. I want every element in the list to be a line. (Ex: ["foo", "bar"] into 2 lines foo and bar ) I've tried pyperclip, but it doesn't support lists.
像pyperclip.copy("\\n".join(final))
?
You could use pyautogui
import pyautogui
test = ['string1', 'string2', 'string3']
for word in test:
pyautogui.typewrite(word + '\n')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.