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
Get And Set Windows Clipboard
From June Kim's <a href=http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/150115>recipe</a>.
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()






Comments
Snippets Manager replied on Tue, 2007/06/05 - 11:43am