"bhaaluu" <[EMAIL PROTECTED]> wrote >> The best way to find out what the functions do is to experiment >> with them. >> >> eg: >> >> >>> f = open('text.txt', 'r') >> >>> f.readlines() >> >> and look at the output. > > I like that idea. I made a simple english plain text file, thus: > > first line > second line > third line > > and named it text.txt. > > I start the Python interactive interpreter: >>>> > >>>> open('text.txt').read() > 'first line\nsecond line\nthird line\n'
And this is where your problems start. You are not creating a file object that you can use, instead you are immediately calling read)() which reads the whole file as a string. All the subsequent operations you do are to the string not the file. If you look at Johns origonal example he first created a file object, f, and then experimented with the methods Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor