469,287 Members | 2,503 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

undo/redo, windows clipboard

With respect to:

Message: 13
Date: Thu, 1 Jan 2004 18:38:47 -0800 (PST)
From: black <qu********@yahoo.com>
Subject: undo and redo ?
To: py*********@python.org
Message-ID: <20************************@web21326.mail.yahoo.co m>
Content-Type: text/plain; charset="us-ascii"

I'm coding with Tkinter and i wonder whether we could get current OS'
clipboard available, and event more, anyone can inspires me how we can
achieve undo and redo function ?

(end quote)

I don't know about undo/redo, but I have sent stuff out of Python via the
clipboard. What works for me (courtesy of Mark Hammond) is:

import win32clipboard, win32con
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText('your string here')
win32clipboard.CloseClipboard()

I found out that if I didn't empty the clipboard before adding to it, the
new data sometimes ended up in the Microsoft Office clipboard, sometimes
not. Now it just shows up each and every time in the plain old Windows
clipboard.

Jul 18 '05 #1
0 1276

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Mickel Grönroos | last post: by
1 post views Thread by black | last post: by
3 posts views Thread by Teis Draiby | last post: by
2 posts views Thread by Christian H | last post: by
2 posts views Thread by Keith | last post: by
5 posts views Thread by Steve | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.