Performance issue

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Apr 2 11:33:47 EST 2005


In <424ec521$0$149$e4fe514c at news.xs4all.nl>, Irmen de Jong wrote:

>> words = file.splitlines()
> 
> You can obtain this list without reading the file in its entirety,
> by using the readlines method of file objects:
> 
> words=open("words.txt").readlines()

This leaves the newline characters at the end of each line while
`str.splitlines()` removes them.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list