Re: [Tutor] Lists in lists

2006-09-17 Thread Brian van den Broek
Kent Johnson said unto the world upon 16/09/06 07:49 PM: > Brian van den Broek wrote: >> Kent Johnson said unto the world upon 16/09/06 04:35 PM: >>> Brian van den Broek wrote: > You say you are new to Python. Well, it might not now be obvious why dictionaries are especially useful, but

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Brian van den Broek wrote: > Kent Johnson said unto the world upon 16/09/06 04:35 PM: >> Brian van den Broek wrote: >>> You say you are new to Python. Well, it might not now be obvious why >>> dictionaries are especially useful, but they are *central* to the >>> pythonic approach. The sooner you

Re: [Tutor] Lists in lists

2006-09-16 Thread PythonIn.dk
Thank you for your tips on my list list. I see how there are advantages to the different approaches. I expect to simply output the text and pipe it somewhere else - so, it is not actually an issue to access the individual posts. Yours, (probably back later) Morten _

Re: [Tutor] Lists in lists

2006-09-16 Thread Brian van den Broek
Kent Johnson said unto the world upon 16/09/06 04:35 PM: > Brian van den Broek wrote: >> Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: >>> # Newbie warning >>> I am making a timeline program. It is fairly simple. >>> I base it on appending lists to a list. >>> Ex. >>> [[year1, "h

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Kent Johnson wrote: > It's handy to assign names to the individual elements of the list. A > variable named 'year' is a lot easier to understand than 'event[0]'. > This is easy to do with tuple unpacking: > > In [6]: for event in events: > ...: year, head, text = event > ...: pri

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Brian van den Broek wrote: > Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: >> # Newbie warning >> I am making a timeline program. It is fairly simple. >> I base it on appending lists to a list. >> Ex. >> [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] >

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Morten Juhl Johansen wrote: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant idea when I did it. It is easy to sort

Re: [Tutor] Lists in lists

2006-09-16 Thread Brian van den Broek
Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant i

Re: [Tutor] Lists in lists

2006-09-16 Thread Andrei
Morten Juhl Johansen wrote: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant idea when I did it. It is easy to sort

[Tutor] Lists in lists

2006-09-16 Thread Morten Juhl Johansen
# Newbie warning I am making a timeline program. It is fairly simple. I base it on appending lists to a list. Ex. [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] This seemed like a brilliant idea when I did it. It is easy to sort. Now, if I want to OUTPUT it, how do I in