Print Special Symbols in Tk GUI

B

Bart Nessux

Using tkinter to create a Python version of Microsoft's winver. Works
great... how can I print the copyright symbol (c) and the registered (R)
symbol into the GUI?

Thanks,
Bart
 
V

vincent wehren

Bart Nessux said:
Using tkinter to create a Python version of Microsoft's winver. Works
great... how can I print the copyright symbol (c) and the registered (R)
symbol into the GUI?

Consider using unicode(\u) or unicode name (\n{name goes here} escapes:

import tkMessageBox
import Tkinter
root = Tkinter.Tk()
root.withdraw()
copyright_symbol = u"\u00A9"
# or use: copyright_symbol = u"\N{COPYRIGHT SIGN}"
registered_symbol = u"\u00AE"
# or use: registered_symbol = u"\N{REGISTERED SIGN}"
msg = u"Copyright: %s, Registered: %s" % (copyright_symbol,
registered_symbol)
tkMessageBox.showinfo("Info", msg)
#root.mainloop()

Regards,
 
B

Bart Nessux

vincent said:
Consider using unicode(\u) or unicode name (\n{name goes here} escapes:

import tkMessageBox
import Tkinter
root = Tkinter.Tk()
root.withdraw()
copyright_symbol = u"\u00A9"
# or use: copyright_symbol = u"\N{COPYRIGHT SIGN}"
registered_symbol = u"\u00AE"
# or use: registered_symbol = u"\N{REGISTERED SIGN}"
msg = u"Copyright: %s, Registered: %s" % (copyright_symbol,
registered_symbol)
tkMessageBox.showinfo("Info", msg)
#root.mainloop()

Regards,

Thanks Vincent... that works great.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top