On 5/25/14 10:09 PM, Dave Angel wrote:
Ned Batchelder Wrote in message:
On 5/25/14 8:55 AM, Igor Korot wrote:
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do s
Ned Batchelder Wrote in message:
> On 5/25/14 8:55 AM, Igor Korot wrote:
>> Hi, ALL,
>> I have a following data structure:
>>
>> my_dict[(var1,var2,var3)] = None
>> my_dict[(var4,var5,var6)] = 'abc'
>>
>> What I'm trying to do is this:
>>
>> for (key,value) in my_dict:
>> #Do some stuff
>>
>>
On Sun, May 25, 2014 at 11:22 PM, Roy Smith wrote:
> Hint: in this case,
> it will happen on the assignment line, so, your next step is to print
> everything out and see what's going on:
>
> for thing in my_dict:
> print thing
> (key, value) = thing
Aside: I know that you (Roy) are still
On 5/25/14 8:55 AM, Igor Korot wrote:
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do some stuff
but I'm getting an error "Too many values to unpack".
What am I
In article ,
Igor Korot wrote:
> for (key,value) in my_dict:
> #Do some stuff
>
> but I'm getting an error "Too many values to unpack".
Several people have already given you the right answer, so I'll just
suggest a general debugging technique. Break this down into the
smallest possible
On 2014-05-25 05:59, Paul Rubin wrote:
> Igor Korot writes:
> > for (key,value) in my_dict:
> > #Do some stuff
> >
> > but I'm getting an error "Too many values to unpack".
>
> Use
> for (key,value) in mydict.iteritems(): ...
You can even use
for ((k1,k2,k3), value) in mydict.iterite
Igor Korot writes:
> for (key,value) in my_dict:
> #Do some stuff
>
> but I'm getting an error "Too many values to unpack".
Use
for (key,value) in mydict.iteritems(): ...
otherwise you loop through just the keys, whicn in your dictionary
happens to be 3-tuples. So you try to unpack a 3
Hi, ALL,
I have a following data structure:
my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'
What I'm trying to do is this:
for (key,value) in my_dict:
#Do some stuff
but I'm getting an error "Too many values to unpack".
What am I doing wrong?
Thank you.
--
https://mail
Le 14/01/2014 23:00, Tobiah a écrit :
On 01/14/2014 01:21 PM, YBM wrote:
Le 14/01/2014 22:10, Igor Korot a écrit :
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright"
On 01/14/2014 02:00 PM, Tobiah wrote:
On 01/14/2014 01:21 PM, YBM wrote:
Le 14/01/2014 22:10, Igor Korot a écrit :
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright"
On 01/14/2014 01:21 PM, YBM wrote:
Le 14/01/2014 22:10, Igor Korot a écrit :
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more infor
Le 14/01/2014 22:10, Igor Korot a écrit :
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
dict = {}
dict[(1,2)] = ('a
On 2014-01-14 21:10, Igor Korot wrote:
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
dict = {}
dict[(1,2)] = ('a','
On 2014-01-14 13:10, Igor Korot wrote:
> Hi, ALL,
> C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more
> information.
> >>> dict = {}
> >>>
On Tue, Jan 14, 2014 at 2:10 PM, Igor Korot wrote:
> Hi, ALL,
> C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
dict
Hi, ALL,
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> dict = {}
>>> dict[(1,2)] = ('a','b')
>>> dict[(3,4)] = ('c','d')
>>
16 matches
Mail list logo