I\'m trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Pytho
You can use winclip32 module! install:
pip install winclip32
to copy:
import winclip32
winclip32.set_clipboard_data(winclip32.UNICODE_STD_TEXT, "some text")
to get:
import winclip32
print(winclip32.get_clipboard_data(winclip32.UNICODE_STD_TEXT))
for more informations: https://pypi.org/project/winclip32/