Iterating over a dictionary's sorted keys

Ivan Van Laningham ivanlan at
Fri May 26 00:03:19 EDT 2000

Hi All--

Alan Daniels wrote:
> On 25 May 2000 08:56:38 GMT, Remco Gerlich
> <scarblac-spamtrap at> wrote:
> [snip...]
> >Why the problem with multiple lines and an extra variable here and there?
> Yes, but the short version reminds me very much of one of my favorite
> python idioms:
>     lines = open("some_file", "rt").readlines()

If you don't want the newlines, you can do this:


in 1.6.

<at-least-you-should-be-able-to>-ly y'rs,
Ivan Van Laningham
Axent Technologies, Inc.
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours

More information about the Python-list mailing list