Skip to main content

A cross-platform clipboard module for Python. (Only handles plain text for now.)

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyperclip-1.7.0.tar.gz (16.0 kB view details)

Uploaded Source

File details

Details for the file pyperclip-1.7.0.tar.gz.

File metadata

  • Download URL: pyperclip-1.7.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

File hashes

Hashes for pyperclip-1.7.0.tar.gz
Algorithm Hash digest
SHA256 979325468ccf682104d5dcaf753f869868100631301d3e72f47babdea5700d1c
MD5 6bbb8598579cc3ee50554b4c59d0cfae
BLAKE2b-256 2d0f4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page