[Tutor] Saving Entry fields in Tkinter
Adam Cripps
kabads at gmail.com
Tue Mar 1 16:31:10 CET 2005
On Tue, 1 Mar 2005 15:30:02 +0000, Adam Cripps <kabads at gmail.com> wrote:
> On Tue, 1 Mar 2005 12:52:57 +0100, Ewald Ertl <ewald.ertl at hartter.com> wrote:
> > Hi!
> >
> > Perhaps this could help you:
> >
> > fileContent=open( "my/file/to/read", "r").readlines()
> >
> > for line in fileContent:
> > print line.strip() # remove leading and trailing whitspace's incl. \n
> >
> > In the loop you could perhaps populate the entry-widgets.
> >
> > HTH
> >
> > Ewald
> >
> > on Tue, 1 Mar 2005 09:22:06 +0000 Adam Cripps <kabads at gmail.com> wrote :
> <snip>
>
Thanks Ewald - this is what I have so far, with a far from perfect result:
File=open( FileName, "r")
readlines = File.readlines()
intcount = 0
newcontent =[]
for line in readlines:
print line.strip() # remove leading and trailing whitspace's incl. \n
self.contentlist[intcount].set(repr(line.strip))
intcount = intcount + 1
But all the entry fields are filled with these and not the text:
<built-in method strip of str object at 0x009983B0>
I'm not sure what else to do here...
any ideas?
Thanks
Adam
--
http://www.monkeez.org
PGP key: 0x7111B833
More information about the Tutor
mailing list