scrolltext widget,appending to

vector Vector180W at netscape.net
Mon Mar 24 17:00:05 EST 2003


Hi
ref:(pythonwin 2.2.2)newbie
Im using a scrolltext widget to display the incoming bytes from the 
seral port. currently the code snip is simply
siobuf=ser.read(nbr)	#nbr =number of bytes in buffer
oldbuf=f.terminalIn.get()	#terminalIn is a scrolltext widget
siobuf=oldbuf+siobuf
f.terminalIn.settext(siobuf)

This means however that each time something is in the serial buffer, 
maybe even only one byte, the entire scrolltext data is copied to oldbuf 
and then written back including the new data. seems a waste of cpu.
Id really prefer just an append type command,like:
f.terminalIn.appendtext(siobuf)
the current code above also seems to have some added \n but that maybe a 
bug elsewhere, Im chasing that now.

any ideas on the append?





More information about the Python-list mailing list