Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with Python 2 and 3. >>> import pyperclip >>> pyperclip.copy('The text to be copied to the clipboard.') >>> ...