0

Hello ! Recently I was doing some text formatting using python and this forum was extremely handy. My problem now is to put any letter in subscript or superscript. Apparently in Unicode there are just a few symbols in superscript but I want to put let say letter "b" in superscript. How I can do this ?
thanks beforehand

5
Contributors
9
Replies
11
Views
7 Years
Discussion Span
Last Post by deonis
0

I think it would be more useful to specify where this text is. If you are working with HTML it would be very different, say, from text in a gui app.

0

I just want to print this text or export it into a file
for example :

letter = x(superscript a)
print letter
0

As Namibnat has already stated, it depends on what you are using to print it. Obviously, if you are printing in the terminal you are limited to ASCII characters and can not do it, as you stated yourself, so you will have to be more specific than just stating that you want to print it, as each printing mechanism has it's own, different way of displaying text. So far, you are just wasting everyone's time.

0

I need any simple way to do a same thing (like code bellow) but with any symbols!

w =  u'\u03B1 (deg)'
s =  'x 'u'\u0363 +y \u0364 +z \u0365'
print "w is: ", w
print "s is: ", s

Program in python which would return this "x 'u'\u0363" in python shell. This is all what I want. :(

0

Thanks Allot very helpful ! Is there are way to do a same thing but with tkinter? Sorry, I want to much probably !

To my knowledge Tkinter has no widget that interprets html code. However wxPython has a wx.html.HtmlWindow() that works similarly.

0

To my knowledge Tkinter has no widget that interprets html code. However wxPython has a wx.html.HtmlWindow() that works similarly.

Thanks for help highly appreciated!!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.