What font is Tkinter using for displaying utf-8 characters?
On my Windows XP, most of the characters with names (unicodedata.na me)
are displayed WYSIWYG.
However, on my Mandrake (warning: Linux newbie), most characters are
displayed as \u???? where ???? is the Hex code.
## start of script Tkinter_gui.py----------
import Tkinter
import ScrolledText
import codecs
import tkFont
##FONT = 'Courier'
class MyFrame(Tkinter .Frame):
def __init__(self, master=None):
self.root = master
Tkinter.Frame._ _init__(self, master)
self.pack(fill= Tkinter.BOTH, expand=1)
## self.textBox = ScrolledText.Sc rolledText(self , font=(FONT, 12))
self.textBox = ScrolledText.Sc rolledText(self ,
font=tkFont.Fon t(size=12))
self.textBox.pa ck(fill=Tkinter .BOTH, expand=1)
def write(self, txt):
self.textBox.in sert(Tkinter.EN D, txt)
self.textBox.se e(Tkinter.END)
self.textBox.up date_idletasks( )
if __name__ == '__main__':
root = Tkinter.Tk()
frame = MyFrame(root)
f = codecs.open('na med.txt', 'r', 'utf-8')
frame.write('\n '.join(f.read() .splitlines()))
f.close()
root.minsize(64 0, 480)
Tkinter.mainloo p()
## end of script ----------
Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
and
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
MS Windows XP SP2
Please CC me directly as I am not subscribed
BTW, tried to e-mail directly (with 2 jpeg screenshots and the named.txt file)
but got the following:
This is an automatically generated Delivery Status Notification
Delivery to the following recipient failed permanently:
py*********@pyt hon.org
Technical details of failure:
PERM_FAILURE: SMTP Error (state 13): 553 rejected, message looks like spam.