tkinter text widget question

W

William Gill

The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like "0.1'. It's great that index can
take a string, but what about looping through rows and columns? Am I
missing a way to use integers directly, or should I create a class that
takes the two integers and returns them formatted as the proper string?

Thanks

Bill
 
R

rafi

William said:
The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like "0.1'. It's great that index can
take a string, but what about looping through rows and columns? Am I
missing a way to use integers directly, or should I create a class that
takes the two integers and returns them formatted as the proper string?

tkinter relies on tk that is for tcl at first, and in tcl every thing is
a string (more or less).

"%s.%s" % (row, column)

should answer your problem easily

my 2 cents
 
W

William Gill

rafi said:
tkinter relies on tk that is for tcl at first, and in tcl every thing is
a string (more or less).

"%s.%s" % (row, column)

Simple enough. (sometimes I can't see the simplest things, without
complicating them)

Thanks,

Bill
 

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,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top