[Tkinter-discuss] Hang on Macosc displaying Arabic in Tkinter Text widget

Michael O'Donnell michael.odonnell at uam.es
Mon Feb 25 17:30:34 CET 2013


Dear all,

  The following code hangs on my MacOSX running Python 3.3.0
and Tk 8.5. It prints 1 but not 2. But if I change the font family to Times,
it doesn't hang. Any ideas?
(The text file (and code) is in the attached zip.)

#########
from tkinter import *
import codecs
strm = codecs.open("arabic.txt", "r", "UTF-16LE")
text = strm.read()
strm.close()
tk = Tk()
tw=Text(tk, height=8,width=60, bg='white', font="Arial 16")
tw.pack()
tw.insert(END, text)
print(1)
tw.update()
print(2)
tk.mainloop()
#####
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.zip
Type: application/zip
Size: 2013 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20130225/a6098b84/attachment.zip>


More information about the Tkinter-discuss mailing list