[Tutor] Multiple Assignment from list.

Paul Kraus pkraus at pelsupply.com
Wed Dec 28 21:23:21 CET 2005


Never mind. i figured this out. the top line of a file i was reading in and 
splitting only had 1 char so "fields" on that line was not a list. I fixed 
this.
On Wednesday 28 December 2005 3:12 pm, Paul Kraus wrote:
> How do I code this in python. Assuming fields is a list of 3 things.
>
> (myfielda, myfieldb, myfieldc) = fields
>
> When i try that I get
> ValueError: need more than 1 value to unpack.
> If i print fields it is in need printed as
> ['somestring','somestring','somestring']
>
> TIA,

-- 
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=


More information about the Tutor mailing list