[英]Copy list to clipboard in Python
I have a list named final
and I want to copy it to the clipboard.我有一个名为
final
的列表,我想将它复制到剪贴板。 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.
(例如: ["foo", "bar"] 分成 2 行foo和bar )我试过 pyperclip,但它不支持列表。
像pyperclip.copy("\\n".join(final))
?
You could use pyautogui你可以使用 pyautogui
import pyautogui
test = ['string1', 'string2', 'string3']
for word in test:
pyautogui.typewrite(word + '\n')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.