On 5/6/23 20:34, 张小平 wrote:
When i use Text or Label to show  this :
[
[1, "PAGE", {"id":"w"}],
[2, "Text", {"caption":"This is first GUI Page,totally different form HTML."}]
]
It shows this:
{1 PAGE {{'id': 'w'}}} {2 Text {{'caption': 'This is first GUI Page,totally different form HTML.'}}}
Have you met this?  Why?  Is it a bug about Text or Label?
All code:
https://gitee.com/zhaoyun004/my-gui-browser/tree/master/Will
python b.by  , then input  "source"  and Enter to see the source code.
I write these to try to create a Python Browser, not use HTML, but Python List , Dict format.


You are passing the data structure to the text widget (a mix of dict/list). If you want the text widget to display it as a string you can do str(self.sources[0])

text.insert(INSERT, str(self.sources[0]))

tkinter is a layer on top of tcl/tk, and it doesn't see the structure itself in the same way as python.


_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to