DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Win32 Clipboard

02.09.2006
| 289 views |
  • submit to reddit
        
import win32clipboard as w
import win32con

def getText():
    w.OpenClipboard()
    d=w.GetClipboardData(win32con.CF_TEXT)
    w.CloseClipboard()
    return d

def setText(aType,aString):
    w.OpenClipboard()
    w.EmptyClipboard()
    w.SetClipboardData(aType,aString)
    w.CloseClipboard()