Fast text display?
Andrew Dalke
dalke at dalkescientific.com
Wed Jun 8 15:01:02 EDT 2005
Christopher Subich wrote:
> My first requirement is raw speed; none of what I'm doing is
> processing-intensive, so Python itself shouldn't be a problem here.
There's raw speed and then there's raw speed. Do you want to
display, say, a megacharacter/second?
> it's highly desirable to have very fast text updates (text
> inserted only at the end)-- any slower than 20ms/line stretches
> usability for fast-scrolling.
Ahh, that's 400 bytes per second. That's pretty slow.
> The second requirement is that it support text coloration.
> The third requirement is cross-platform-osity
qtextedit has all of those. See
http://doc.trolltech.com/3.3/qtextedit.html
Looks like LogText mode is exactly what you want
http://doc.trolltech.com/3.3/qtextedit.html#logtextmode
] Setting the text format to LogText puts the widget in a special mode
] which is optimized for very large texts. Editing, word wrap, and rich
] text support are disabled in this mode (the widget is explicitly made
] read-only). This allows the text to be stored in a different, more
] memory efficient manner.
and
] By using tags it is possible to change the color, bold, italic and
] underline settings for a piece of text.
Depending on what you want, curses talking to a terminal might be
a great fit. That's how we did MUDs back in the old days. :)
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list