While setting up some unit tests, I came to the conclusion that a
Tkinter Text widget can never be empty, but will always (?) contain a
\n. Here is a brief example:
[color=blue][color=green][color=darkred]
>>> import Tkinter
>>> t = Tkinter.Text()
>>> t.get(0.0, Tkinter.END)[/color][/color][/color]
'\n'[color=blue][color=green][color=darkred]
>>> t.delete(0.0, Tkinter.END)
>>> t.get(0.0, Tkinter.END)[/color][/color][/color]
'\n'[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
My apologies, but I have not checked whether or not this can be
reproduced in Tcl/Tk (which I think might have been appropriate).
My question is: Is there *always* a trailing \n, is this a bug, or am
I doing something silly?
Thanks!
Harry.
Tkinter Text widget can never be empty, but will always (?) contain a
\n. Here is a brief example:
[color=blue][color=green][color=darkred]
>>> import Tkinter
>>> t = Tkinter.Text()
>>> t.get(0.0, Tkinter.END)[/color][/color][/color]
'\n'[color=blue][color=green][color=darkred]
>>> t.delete(0.0, Tkinter.END)
>>> t.get(0.0, Tkinter.END)[/color][/color][/color]
'\n'[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
My apologies, but I have not checked whether or not this can be
reproduced in Tcl/Tk (which I think might have been appropriate).
My question is: Is there *always* a trailing \n, is this a bug, or am
I doing something silly?
Thanks!
Harry.
Comment