Weird clipboard behavior?

newgene newgene at bigfoot.com
Fri Oct 17 16:19:16 EDT 2003


Hi, group,
    A weird clipboard behavior for your help:

==============Code==============
from Tkinter import *
import tkMessageBox

root=Tk()
root.withdraw()
root.clipboard_clear()
root.clipboard_append('python rules!')
tkMessageBox.showinfo("Done","Text pasted!") 
=============================================

============symptom==============
1. When messagebox shows up, you click "OK" to exit, then you can not
get "python rules!" anymore. Clipboard is empty.
2.However, if you paste "python rules!" from the clipboard (ie,ctrl-v
in textpad) before you click "OK" to exit. "python rules!" is still on
the clipboard after you exit this small app.
3. The above test is on python2.3/win2k. I also tested it on linux
(python2.3/rh7.1). Content was always lost after you exit, on matter
if you paste it or not before exit.
===============================================
Q: How to keep content in clipboard after exit?

Thanks in advance!

Chunlei




More information about the Python-list mailing list