Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Dave Angel
On 04/23/2013 02:58 AM, inshu chauhan wrote: Yes Simultaneously means all three running at the same time, I looked up zip just now, but will it not disturb my dictionaries ? And yes the dictionaries have same number of keys. More crucially, do all the dictionaries have the *same* keys? If so,

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Duncan Booth
inshu chauhan wrote: > This statement is giving me the following error > > Statement: > for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), > pixel_count.iterkeys())): > > Error: > Traceback (most recent call last): > File "C:\Users\inshu\Desktop\Training_segs_trial2.py", l

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Ulrich Eckhardt
Am 23.04.2013 09:13, schrieb inshu chauhan: This statement is giving me the following error Statement: for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), pixel_count.iterkeys())): Error: Traceback (most recent call last): File "C:\Users\inshu\Desktop\Training_segs_trial2.

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Chris Angelico
On Tue, Apr 23, 2013 at 5:13 PM, inshu chauhan wrote: > This statement is giving me the following error > > Statement: > for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), > pixel_count.iterkeys())): You probably want to sort them separately. By the way, using iterkeys() isn't

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread inshu chauhan
This statement is giving me the following error Statement: for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), pixel_count.iterkeys())): Error: Traceback (most recent call last): File "C:\Users\inshu\Desktop\Training_segs_trial2.py", line 170, in access_segments(segimage

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread inshu chauhan
Thanks Gary. > > Be clearer about the problem please. > > Do you wish to produce a loop that: > On pass 1, each of p,k, and t hold the first item of their respective > lists, and > on pass 2, each of p,k, and t hold the second item of their respective > lists, and > so on > until one (or a

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread inshu chauhan
zip isn't doing the required On Tue, Apr 23, 2013 at 12:28 PM, inshu chauhan wrote: > Yes Simultaneously means all three running at the same time, I looked up > zip just now, but will it not disturb my dictionaries ? > And yes the dictionaries have same number of keys. > > thanks > > > On Tue, A

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Gary Herron
On 04/22/2013 11:40 PM, inshu chauhan wrote: i have to implement the below line in one of my code: for p in sorted(segments.iterkeys()) and for k in sorted(class_count.iterkeys()) and for j in sorted(pixel_count.iterkeys()): Its giving me a syntax error which is obvious, but how can I make

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread inshu chauhan
Yes Simultaneously means all three running at the same time, I looked up zip just now, but will it not disturb my dictionaries ? And yes the dictionaries have same number of keys. thanks On Tue, Apr 23, 2013 at 12:16 PM, Chris Angelico wrote: > On Tue, Apr 23, 2013 at 4:40 PM, inshu chauhan >

Re: Running simultaneuos "FOR" loops

2013-04-22 Thread Chris Angelico
On Tue, Apr 23, 2013 at 4:40 PM, inshu chauhan wrote: > i have to implement the below line in one of my code: > > for p in sorted(segments.iterkeys()) and for k in > sorted(class_count.iterkeys()) and for j in sorted(pixel_count.iterkeys()): > > Its giving me a syntax error which is obvious, but

Running simultaneuos "FOR" loops

2013-04-22 Thread inshu chauhan
i have to implement the below line in one of my code: for p in sorted(segments.iterkeys()) and for k in sorted(class_count.iterkeys()) and for j in sorted(pixel_count.iterkeys()): Its giving me a syntax error which is obvious, but how can I make all three for loop run simultaneously or any other