[Tutor] Saving Entry fields in Tkinter
Adam Cripps
kabads at gmail.com
Tue Mar 1 10:22:06 CET 2005
I'm writing an application which has rows of Entry fields (created in
a loop - see previous thread; and thanks guys!). All the content of
the Entry fields are accessed through self.contentlist[i].get()
Now I'm trying to save the content of those fields in a friendly
format. I've used pickle in the past, but experienced problems with
pickling Tkinter widgets.
I'm saving using this method :-
for i in self.contentlist:
saving = i.get() + "\n"
f.write(saving)
f.close()
which creates a text file with each entry field separated with a "\n".
What would be a good way to open this file and re-populate the entry
fields with the content? I'm not sure how to parse the text according
to the \n separator.
Am I going down the right path here?
TIA
Adam
--
http://www.monkeez.org
PGP key: 0x7111B833
More information about the Tutor
mailing list