import pyperclip #pip install pyperclip pyperclip.copy('Hello world!') pyperclip.paste()