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 is as follows:
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:
And, that's it.
$ xerox some string
$ echo some string | xerox
>>> xerox some string
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
(c) 2016 Kenneth Reitz.