Re: Help with parsing a list

2009-12-17 Thread thunderf...@gmail.com
On Dec 17, 6:05 am, Sallu wrote: > Hi i tried with thunderfoot code > > error: > > Traceback (most recent call last): >   File "", line 8, in ? > ValueError: need more than 1 value to unpack- Hide quoted text - > hence, my 'seemingly' functional qualification. :) that's most likely to due to a d

Re: Help with parsing a list

2009-12-16 Thread thunderf...@gmail.com
not as slick as Emile's (didn't think about using strip() ), but seemingly functional: data = ['key1: data1','key2: data2','key3: data3',' key4: ',' \tdata4.1',' \tdata4.2',' \tdata4.3','key5: data5'] result = {} for item in data: if item.endswith(': '): currkey = item[:-2] r