Program termination problem

Garyr garyr at fidalgo.net
Fri Mar 29 21:31:56 EST 2002


Thanks for your replies.

The Tkinter selection_get(selection='CLIPBOARD') code works fine but the
program still hangs when invoked from a DOS window but does terminate
OK when invoked from an icon.


"Garyr" <garyr at fidalgo.net> wrote in message
news:ua6r509m5uradc at corp.supernews.com...
> I have a program that displays a Tkinter Text widget. I would like to be
> able to place text in the window via the clipboard. I found the following
> clipboard code in a Google post:
>
> import win32clipboard as clip
>          ...
>         clip.OpenClipboard(0)
>         if clip.IsClipboardFormatAvailable(clip.CF_TEXT):
>            newText = clip.GetClipboardData(clip.CF_TEXT)
>           textwidget.insert(END, newText)
>         clip.CloseClipboard()
>
> This works but it causes the program to hang on exit. mainloop() returns
but
> the DOS window is frozen. The problem is associated with the clipboard
> functions; i.e., commenting the insert line has no effect.
>
> I'm using Python 2.1 (Pythonwin 2.1.211) on Win98.
> Any suggestions?
>
> Thanks in advance,
> Gary Richardson
>
>











More information about the Python-list mailing list