Hi guys :)

Did a bit of searching but couldn't find much on this, so I thought I'd ask here.

I want a Tkinter Label to display a polynomial, so naturally I need to put some superscript formatting onto it. But I can't seem to work out how to.

Any help would be much appreciated, thanks :)

Stonehambey

Recommended Answers

Looks like somebody made a widget that will handle sub/superscripting... I suggest downloading their source code and figuring out how they do it... then possibly try to implement it for your own purposes.

Jump to Post

All 4 Replies

Looks like somebody made a widget that will handle sub/superscripting... I suggest downloading their source code and figuring out how they do it... then possibly try to implement it for your own purposes.

My semi-educated guess is that a primitive GUI toolkit like Tkinter does not have a superscripting option. For that you need wxPython, it has widgets like wx.lib.fancytext or wx.html.HtmlWindow that use simplified xml or html code. For an example see:
http://www.daniweb.com/forums/post782156-106.html

Thanks for the replies :)

I have wxPython installed on my system and have read a number of times that it is very powerful compared to Tkinter. My only reservation is that I value portability with minimal fuss. If I write an app using tkinter in linux, someone would be able to run it on windows so long as they have Python installed. But this is not the case with wxPython am I right? They would need to install wxPython on their system as well.

Unless I ship the wxPython modules with my application. Would this be a suitable workaround?

Programs like py2exe work very well with wxPython and will include the needed parts in the distribution package of your code for Windows users. Also wxPython is available for most of the common Operating Systems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.