import pyperclip def copy_to_clipboard ( text ) : pyperclip . copy ( text ) copy_to_clipboard ( "Hello, World!" )