bahoo wrote:
[ ... ]
> Thanks, this helped a lot.
> I am now using the suggested
> map(str.strip, open('source.txt').readlines())
> 
> However, I am a C programmer, and I have a bit difficulty
> understanding the syntax.
> I don't see where the "str" came from, so perhaps the output of
> "open('source.txt').readlines()" is defaulted to "str?

You can do without.

[x.strip() for x in open ('source.txt', 'r')]

will also work.

        Cheers,         Mel.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to