Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Garry Bettle
On Wed, Jul 8, 2009 at 21:37, Kent Johnson wrote: > On Wed, Jul 8, 2009 at 1:22 PM, Rich Lovely wrote: > >> If you really want to speed up the search, you could turn the list of lists >> into a dict, using the first value in each sublist as a key: >> >> dct = dict((i[0], i[1:]) for i in lst) >> >>

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Kent Johnson
On Wed, Jul 8, 2009 at 1:22 PM, Rich Lovely wrote: > If you really want to speed up the search, you could turn the list of lists > into a dict, using the first value in each sublist as a key: > > dct = dict((i[0], i[1:]) for i in lst) > > Then you can access it using the normal dictionary interfac

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Kent Johnson
On Wed, Jul 8, 2009 at 12:13 PM, Garry Bettle wrote: > Hi, > > I've been programming for over 20 yrs, but only the last few in python > and then only in dribs and drabs. > > I'm having a difficult time parsing a delimited string. > > e.g. > > 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: > 381

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Rich Lovely
On 8 Jul 2009, at 17:13, Garry Bettle wrote: Hi, I've been programming for over 20 yrs, but only the last few in python and then only in dribs and drabs. I'm having a difficult time parsing a delimited string. e.g. 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: 3818854~0~24104.08~4.5~~2

[Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Garry Bettle
Hi, I've been programming for over 20 yrs, but only the last few in python and then only in dribs and drabs. I'm having a difficult time parsing a delimited string. e.g. 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: 3818854~0~24104.08~4.5~~22.1~false|4.4~241.67~L~1~4.3~936.0~L~2~4.2~210.54