See Pyperclip. Example (taken from Pyperclip site):

import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()

Also, see Xerox. But it appears to have more dependencies.

Answer from robert on Stack Overflow
🌐
IPython
ipython.readthedocs.io › en › 8.28.0 › api › generated › IPython.lib.clipboard.html
Module: lib.clipboard — IPython 8.28.0 documentation
October 2, 2024 - If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release). Utilities for accessing the platform’s clipboard.
🌐
IPython
ipython.readthedocs.io › en › 8.18.0 › api › generated › IPython.lib.clipboard.html
Module: lib.clipboard — IPython 8.18.0 documentation
November 24, 2023 - If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release). Utilities for accessing the platform’s clipboard.
🌐
PyPI
pypi.org › project › pyclip
pyclip
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
IPython
ipython.readthedocs.io › en › 8.18.1 › api › generated › IPython.lib.clipboard.html
Module: lib.clipboard — IPython 8.18.1 documentation
November 27, 2023 - If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release). Utilities for accessing the platform’s clipboard.
Find elsewhere
🌐
GitHub
gist.github.com › ur0n2 › e589a449fa0c7bba0766fa5561b7a573
Clipboard copy & paste with python · GitHub
Clipboard copy & paste with python. GitHub Gist: instantly share code, notes, and snippets.
🌐
YouTube
youtube.com › python developer
Python3 - How to work with windows clipboard? winclip32 will help! - YouTube
pypi: https://pypi.org/project/winclip32/ github: https://github.com/PyPcDeV/winclip32 creator(me): pypcdev@gmail.com This is full-functional python3 library...
Published   March 11, 2020
Views   160
🌐
IPython
ipython.readthedocs.io › en › 8.19.0 › api › generated › IPython.lib.clipboard.html
Module: lib.clipboard — IPython 8.19.0 documentation
December 22, 2023 - If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release). Utilities for accessing the platform’s clipboard.
🌐
PyPI
pypi.org › project › clipboard
clipboard · PyPI
A cross platform clipboard operation library of Python. Works for Windows, Mac and Linux.
      » pip install clipboard
    
Published   May 22, 2014
Version   0.0.4
🌐
Medium
medium.com › @prashantgupta24 › how-to-create-your-own-clipboard-manager-using-python-and-tkinter-e693aa27fffc
How to create your own clipboard manager using python and Tkinter | by Prashant Gupta | Medium
October 5, 2018 - The application mainly consists of 2 elements, a GUI handler(Tkinter) and a clipboard handler(pyperclip). Let’s see both of them in detail. The Tkinter module contains everything we need to work with the toolkit. The first thing we need to do for a Tkinter application is import the tkinter module (it’s named Tkinter in python 2.x and tkinter in python 3.x), and create the root element:
🌐
Note.nkmk.me
note.nkmk.me › home › python
Copy and Paste Text to the Clipboard with pyperclip in Python | note.nkmk.me
January 30, 2024 - In Python, pyperclip allows you to copy text to the clipboard, paste text from the clipboard, and even monitor the clipboard for updates. pyperclip · PyPI asweigart/pyperclip: Python module for cross ...
🌐
Reddit
reddit.com › r/python › copykitten: the missing clipboard library for python
r/Python on Reddit: copykitten: the missing clipboard library for Python
February 21, 2024 -

What My Project Does

copykitten is a clipboard library with support for text and images and a simple API. It's built around Rust arboard library. Thanks to this, it's multiplatform and doesn't require any dependencies.

Target Audience

Developers building CLI/GUI/TUI applications. The library has beta status on PyPI, but the underlying Rust library is pretty stable, being used in commercial projects like Bitwarden and 1Password.

Comparison

There are lots of other clipboard libraries for Python: pyperclip, jaraco.clipboard, pyclip, just to name a few. However, most of them are not maintained for years and require the presence of additional libraries or tools in the operating system. copykitten doesn't suffer from these shortcomings.

A bit of history

Throughout my years with Python there were several times when I needed to use the clipboard in my applications and every time I had to fall back to some shaky methods like asking the end user to install xclip and calling subprocess.run. This never felt great.

Right now I'm making a multiplayer TUI game (maybe I’ll showcase it later too :) ), where users can copy join game codes into the clipboard to easily share it (much like Among Us). This is how I came to the idea of making such a library. I also wanted to try Rust for a long time, and so this all just clicked in my head instantly.

I had fun building it and definitely had some pain too and learned a bit of nitty-gritty details about how clipboards work in different operating systems. Now I hate Windows.

With this post I hope to gain some attention to the project so that I can receive feedback about the issues and maybe feature requests and spread the word that there's a modern, convenient alternative to the existing packages.

Feel free to try it out: https://github.com/Klavionik/copykitten

🌐
Python.org
discuss.python.org › python help
Copy to system clipboard - Python Help - Discussions on Python.org
June 2, 2022 - I’m working on a an app (my 2nd GUI app) that generates a hash value (AKA: checksum) based on a selected file. Right now, the hash value is displayed in a Text Widget, which is has the ‘state’ set to ‘disabled’, so that …
🌐
GitHub
gist.github.com › dl6nm › 3a1a09720eab2ab6e2eaabc357e5b6fd
Add text from Python to the Windows clipboard · GitHub
Add text from Python to the Windows clipboard. GitHub Gist: instantly share code, notes, and snippets.
🌐
PyPI
pypi.org › project › pyperclip
pyperclip · PyPI
A cross-platform clipboard module for Python. (Only handles plain text for now.)
      » pip install pyperclip
    
Published   Sep 26, 2025
Version   1.11.0
🌐
YouTube
youtube.com › watch
Clipboard Copy In Python Using Pyperclip Module - YouTube
In this video we will learn about Clipboard Copy in Python using Pyperclip module. Please subscribe to support Asim Code!https://www.youtube.com/channel/UC2w...
Published   June 2, 2019
🌐
YouTube
youtube.com › code tech
Python Multi-clipboard Project For Beginners Tutorial - YouTube
In this video we are going to see how to make flex box responsive for mobile devices.I hope you like my tutorials , Pardon my mistakes.Please subscribe to my...
Published   March 31, 2022
Views   1K