Re: problem of converting a list to dict

2008-01-09 Thread Louis . Soninhu
oops, it seems there are other 'meaningless' item, which actually caused the problem Thanks for helps -- http://mail.python.org/mailman/listinfo/python-list

Re: problem of converting a list to dict

2008-01-09 Thread Louis . Soninhu
On Jan 9, 3:05 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have a list like this > > > mylist=['','tom=boss','mike=manager','paul=employee','meaningless'] > > > I'd like to remove the first and the last item as they are irrevalent, > > and convert it to the dict: >

Re: problem of converting a list to dict

2008-01-09 Thread Louis . Soninhu
that's very strange... the list I give here is almost same as the real list, except for the length. Thanks Marc, I'll go check what's wrong elsewhere -- http://mail.python.org/mailman/listinfo/python-list

problem of converting a list to dict

2008-01-09 Thread Louis . Soninhu
Hi pals I have a list like this mylist=['','tom=boss','mike=manager','paul=employee','meaningless'] I'd like to remove the first and the last item as they are irrevalent, and convert it to the dict: {'tom':'boss','mike':'manager','paul':'employee'} I tried this but it didn't work: mydict={} fo

Re: very newbie question about exception handling

2007-12-25 Thread Louis . Soninhu
Thanks guys! It worked. Merry Christmas! -- http://mail.python.org/mailman/listinfo/python-list

very newbie question about exception handling

2007-12-24 Thread Louis . Soninhu
code sample: -- i=input() try: x=int(i) print "you input an integer" except ValueError: print "you must input an integer" when I input a value like, b I got the traceback message instead of prop