[python-win32] Copying a string to the clipboard

Bob Gailer bgailer at alum.rpi.edu
Sat Oct 11 18:40:01 EDT 2003


At 03:04 PM 10/11/2003, Tony Evershed wrote:

>I almost *know* this one has been asked before, but a trawl through Google
>and the win32 extensions help failed to turn up anything of use...
>
>Is it possible to copy a string to the clipboard, such that if I click on
>'Paste' in Notepad the text will appear?

import win32clipboard
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(text)
win32clipboard.CloseClipboard()

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003


More information about the Python-win32 mailing list