News for hackers. Stuff that matters.
Re:First Impressions of Python from a Java Developer by rbanffy on Monday November 08, 2010 @05:44PM (#1884368)
You could also

    [ do_something_to(line) for line in open('todo.txt') ]
Re:First Impressions of Python from a Java Developer by xiongchiamiov on Monday November 08, 2010 @06:52PM (#1884578)
Although you'd probably want to replace those square brackets with parens to make it a generator, if you're dealing with a largish file.
Re:First Impressions of Python from a Java Developer by rbanffy on Monday November 08, 2010 @07:36PM (#1884755)
Indeed. Hope it's not a huge file.