Issuing a sqilte query, picking a random result, and copying to the system clipboard

Felix Yan felixonmars at archlinux.org
Tue Jun 23 10:08:36 EDT 2015


On 06/22/2015 07:51 PM, Tim Chase wrote:
> On Win32, you'd need the Win32 add-on libraries to shove things onto
> the clipboard, while under X, you'd need other facilities (either
> using Tkinter or piping to something like xclip(1)), and yet another
> way of doing things on MacOS.

Or you may want an existing library for all these. For example, pyperclip:

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

FYI: https://pypi.python.org/pypi/pyperclip

-- 
Regards,
Felix Yan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150623/f27cc3f7/attachment.sig>


More information about the Python-list mailing list