I can receive serial data and can print on the window screen(Tkinter top).when i receive serial data again, this newly received serial data should start printing on the window screen by wiping out the previous serial data.This process has to happen for every received serial data. I had a code to receive and print data on window, but it prints all the received data on the screen with out wiping the old data.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In that case, all you have to do is remove the previous content of the widget just before printing the new one. If you have an Entry widget, use the delete
method:
entry.delete(0, 'end')
# print new serial data
Or if you have a Text widget:
text.delete(1.0, 'end')
# print new serial data