Pasting from clipboard with Tkinter

MA Booker apetala2 at yahoo.com
Tue Sep 25 12:40:35 EDT 2001


I'm a bit of a newbie with Tkinter, and I've developed a fairly simple
entry screen application with Tkinter and Python Mega Widgets. This
application is being used on a Windows NT machine.

The application has a series of entry fields packed one below the
other. I can copy a single line of text from another Windows
application and use Ctrl-v to paste it into one of the entryfields.
However, if I copy multiple line from another program (such as
Notepad, Excel, Word, etc.), all of the copied text appears in one
entry like this:

Entry 1: line1[square]line2[square]line3
Entry 2:
Entry 3:

I'm assuming that the little [square]'s correspond to CR and/or NL
characters

What I want it to do is this:

Entry 1: line1
Entry 2: line2
Entry 3: line3

Basically, I have a user that wants to copy a column from an Excel
spreadsheet into the series of entries, and I cannot figure out how to
get it to work.

Any ideas out there?



More information about the Python-list mailing list