Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'syntax': 0.04; 'error:': 0.07; 'cc:addr:python-list': 0.11; '170,': 0.16; '23,': 0.16; 'callable': 0.16; 'data)': 0.16; 'dictionaries': 0.16; 'keys.': 0.16; 'required\xa0': 0.16; 'skip:z 30': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'not,': 0.20; '>>>': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'cc:2**0': 0.24; '>': 0.26; 'define': 0.26; 'skip:" 40': 0.26; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '???': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'file': 0.32; 'run': 0.32; 'url:python': 0.33; 'running': 0.33; '(most': 0.33; 'skip:s 30': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'doing': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'so,': 0.37; 'implement': 0.38; 'skip:& 10': 0.38; 'pm,': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'subject:" ': 0.39; 'skip:p 20': 0.39; '8bit%:6': 0.40; 'url:mail': 0.40; 'how': 0.40; 'zip': 0.64; 'more': 0.64; 'yes': 0.68; 'disturb': 0.91; 'obvious,': 0.91; 'subject:FOR': 0.91; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:cc:content-type; bh=++4y+wRwbd5uFa84dEW+tYKvnTWvQKPrZb3tKk1UzyY=; b=ZFamaW/H4mMhWM5xVbqwYfSywCSoRM0AzkcKXNr1SS1/WvH/pLHm7GVDNzajJhZOjL L6GR+EuxR1pyrzVK/ts31x+p8Pim3IGyG0ey5M3lPitwVNYxXDSVcdMmY2g/sMwJobqc hxgZylSEWkV/aaIR/pyz5K8ZvT2O6opA0I0SbVA3s2/Jey31gWggvGpGFk3pNbiyAcQl eltyME4gCW2FZvDQGbkFef6bS+7u52i3887gSigUoDW023cjEgVsfLzCvF1G+0MzEBI6 YQGr9smuF4BLQE4E97UtlUSbIAUT2m0HlMPTzavnHHEd0PA77qpstLjbLp+oa4ppJtHV meSA== MIME-Version: 1.0 X-Received: by 10.50.7.42 with SMTP id g10mr22884070iga.97.1366701187982; Tue, 23 Apr 2013 00:13:07 -0700 (PDT) In-Reply-To: References: Date: Tue, 23 Apr 2013 12:43:07 +0530 Subject: Re: Running simultaneuos "FOR" loops From: inshu chauhan Cc: "python-list@python.org" Content-Type: multipart/alternative; boundary=089e0111cf50d2ec2204db01ea7c X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 138 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366701190 news.xs4all.nl 2236 [2001:888:2000:d::a6]:38324 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44159 --089e0111cf50d2ec2204db01ea7c Content-Type: text/plain; charset=ISO-8859-1 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, data) File "C:\Users\inshu\Desktop\Training_segs_trial2.py", line 147, in access_segments for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), pixel_count.iterkeys())): TypeError: 'dictionary-keyiterator' object is not callable On Tue, Apr 23, 2013 at 12:33 PM, inshu chauhan wrote: > 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, Apr 23, 2013 at 12:16 PM, Chris Angelico wrote: >> >>> 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 how can I make all >>> three >>> > for loop run simultaneously or any other way to do this simultaneous >>> work >>> > ??? >>> >>> Define simultaneously. Do the three dictionaries have the same number >>> of keys? If so, look up zip() or itertools.izip; if not, you may have >>> to more clearly define "simultaneous". >>> >>> ChrisA >>> -- >>> http://mail.python.org/mailman/listinfo/python-list >>> >> >> > --089e0111cf50d2ec2204db01ea7c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
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:=A0
Traceback (most recent call= last):
=A0 File "C:\Users\inshu\Desktop\Training_segs_trial= 2.py", line 170, in <module>
=A0 =A0 access_segments(s= egimage, data)
=A0 File "C:\Users\inshu\Desktop\Training_segs_trial2.py", l= ine 147, in access_segments
=A0 =A0 for p, k, j in zip(sorted(seg= ments.iterkeys(), class_count.iterkeys(), pixel_count.iterkeys())):
TypeError: 'dictionary-keyiterator' object is not callable





On Tue, Apr 23, 2013 at 12:33 PM, = inshu chauhan <insideshoes@gmail.com> wrote:
zip isn't doing the req= uired=A0


On Tue, Apr 23, 2013 at 12:28 PM, inshu chau= han <insideshoes@gmail.com> wrote:
Yes Simultaneously means al= l three running at the same time, I looked up zip just now, but will it not= disturb my dictionaries ?=A0
And yes the dictionaries have same number of keys.=A0

thanks=A0

On Tue, Apr 23, 2013 at 12:16 PM, Chris An= gelico <rosuav@gmail.com> wrote:
On Tue, Apr 23, 2013 at 4:40 PM, i= nshu chauhan <insideshoes@gmail.com> wrote:
> i have to implement the below line in one of my code:
>
> for =A0p in sorted(segments.iterkeys()) and for k in
> sorted(class_count.iterkeys()) and for j in sorted(pixel_count.iterkey= s()):
>
> Its giving me a syntax error which is obvious, but how can I make all = three
> for loop run simultaneously or any other way to do this simultaneous w= ork
> ???

Define simultaneously. Do the three dictionaries have the same = number
of keys? If so, look up zip() or itertools.izip; if not, you may have
to more clearly define "simultaneous".

ChrisA
--
http://mail.python.org/mailman/listinfo/python-list



--089e0111cf50d2ec2204db01ea7c--