Print Special Symbols in Tk GUI

vincent wehren vincent at visualtrans.de
Fri Aug 13 07:11:44 CEST 2004


"Bart Nessux" <bart_nessux at hotmail.com> schrieb im Newsbeitrag
news:cfh9pr$fnb$1 at solaris.cc.vt.edu...
> 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,
--

Vincent Wehren

>
> Thanks,
> Bart





More information about the Python-list mailing list