Copy + Paste in Python.
Python
Latest commit 4df98ab Jul 30, 2016 @kennethreitz committed on GitHub Merge pull request #29 from anne-decusatis/patch-1
Update README with linux dependency
Permalink
Failed to load latest commit information.
xerox Update core.py Feb 5, 2016
.gitignore 2012 Jan 13, 2012
LICENSE 2016 Feb 4, 2016
MANIFEST.in Setup.py for pypi. Sep 9, 2010
README.rst Update README with linux dependency Jul 29, 2016
setup.py v0.4.1 Feb 4, 2016
test_xerox.py Allow optional X selection copy/paste on Linux Jul 13, 2014

README.rst

Xerox: Copy + Paste for Python

Xerox is a copy + paste module for python. It's aim is simple: to be as incredibly simple as possible.

Supported platforms are currently OS X, X11 (Linux, BSD, etc.), and Windows.

If you can make it simpler, please fork.

Usage

Usage is as follows:

xerox.copy(u'some string')

And to paste:

>>> xerox.paste()
u'some string'

On Linux you can optionally also copy into the X selection clipboard for middle-click-paste capability:

xerox.copy(u'Some string', xsel=True)

And you can choose to paste from the X selection rather than the system clipboard:

xerox.paste(xsel=True)

And, that's it.

Command Line

To copy:

$ xerox some string

or:

$ echo some string | xerox

To paste:

>>> xerox
some string

Installation

To install Xerox, simply:

$ pip install xerox

Note: If you are installing xerox on Windows, you will also need to install the pywin32 module.

Note: On X11 systems, Xerox requires Xclip, which can be found through your system package manager (e.g. apt-get install xclip) or at https://github.com/astrand/xclip

Legal Stuff

MIT License.

(c) 2016 Kenneth Reitz.