Skip to content
Python module for cross-platform clipboard functions.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Changed the Error link Mar 6, 2017
src/pyperclip Bumping version to 1.7.0, fixing small index out of range bug. Sep 24, 2018
tests Moved module to src folder, added __main__.py Sep 24, 2018
.gitignore
AUTHORS.txt Fix for issue #129, where unicode text caused exceptions on Python 2. Sep 24, 2018
CHANGES.txt
LICENSE.txt
MANIFEST.in x Aug 27, 2018
Pipfile Moved module to src folder, added __main__.py Sep 24, 2018
Pipfile.lock
README.md
setup.py
tox.ini Added pipenv and tox updates. Sep 24, 2018

README.md

Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with Python 2 and 3.

pip install pyperclip

Al Sweigart al@inventwithpython.com BSD License

Example Usage

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

Currently only handles plaintext.

On Windows, no additional modules are needed.

On Mac, this module makes use of the pbcopy and pbpaste commands, which should come with the os.

On Linux, this module makes use of the xclip or xsel commands, which should come with the os. Otherwise run "sudo apt-get install xclip" or "sudo apt-get install xsel" (Note: xsel does not always seem to work.)

Otherwise on Linux, you will need the gtk or PyQt4 modules installed.

You can’t perform that action at this time.