[Tkinter-discuss] Persistent text-widget tags: saving tags in text-files.

Kevin Walzer kw at codebykevin.com
Mon Jun 14 16:27:31 CEST 2010

On 6/13/10 11:50 AM, Steve Solomon wrote:
> Hello,
> Is it possible to save and reload a text document with its'  tags still
> embedded in a document produced in the Text widget, and if so how? It
> seems that it should be possible in order not to discard hours of work
> formatting a text file.
> Thank you
> Steve

The text widget has a "dump" command that should do what you want: it 
returns all data in the text widget, including tags. See the Tk text man 

For a more complete example, http://wiki.tcl.tk/9167 might be helpful. 
You'll have to translate the Tcl to Python.

Kevin Walzer
Code by Kevin

More information about the Tkinter-discuss mailing list