tab replace to space 4 (rmlibre)

rmlibre at riseup.net rmlibre at riseup.net
Sun Dec 1 13:10:20 EST 2019


> Its just that I've just began to touch tkinter, and would like to know of
> bug-related pitfalls before I waste energy on trying to figure out what I
> did wrong. :-\

One thing which is not obvious or easy to debug: Text widgets have some
kind of 
inefficiency related to really long lines that don't have line breaks.
The 
result is that your cpu will be completely gobbled up if you have a
sufficiently
long line. I haven't run any tests to get an accurate view of what the
breaking 
point is. But one the cores in my cpu was hold up at 100% when
displaying 
many many thousands of characters without line breaks. After lots of
debugging
and optimization finding, I just happened to google for "cpu load issue
with" 
each of the widgets I was using and discovered that this indeed was the
cause
of the cpu load. Swapping in line breaks at regular, known intervals
quickly
fixed this.

tl;dr
Google for "issue with tkinter <widget>" for the widgets you'll be
using, or 
"<issue> with tkinter" if you're experiencing a particular issue and are
not 
sure if it could be caused for some reason by tkinter.



More information about the Python-list mailing list