python - Writing contents from a Tkinter text widget as such? -
i using tkinter in python display output in text window. found 'get' function can retrieve text content window. have text portions marked different background colours. possible copy content such along these colours file, html or doc?
thanks!
there no support want. can call .dump()
method return information including both text , tags. however, data not in standard format , there's no support loading data in. it's possible write software load in, have work yourself.
the best description of returned tcl/tk man pages. states in part:
pathname dump ?switches? index1 ?index2?
return contents of text widget index1 to, not including index2, including text , information marks, tags, , embedded windows. if index2 not specified, defaults 1 character past index1. information returned in following format:
key1 value1 index1 key2 value2 index2 ...
the possible key values text, mark, tagon, tagoff, image, , window. corresponding value text, mark name, tag name, image name, or window name. index information index of start of text, mark, tag transition, image or window.
n.b. documentation tcl language. in tkinter call method widget.dump(...)
, , returns tuple.
Comments
Post a Comment