471,573 Members | 1,350 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

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 1330

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
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.