undo/redo, windows clipboard

J

John Benson

With respect to:

Message: 13
Date: Thu, 1 Jan 2004 18:38:47 -0800 (PST)
From: black <[email protected]>
Subject: undo and redo ?
To: (e-mail address removed)
Message-ID: <[email protected]>
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top