Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103291

Re: how to get the list form dictionary's values

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: how to get the list form dictionary's values
Date Sun, 21 Feb 2016 15:06:55 +0100
Organization None
Lines 35
Message-ID <mailman.7.1456063625.20994.python-list@python.org> (permalink)
References <554c09f2-6a6b-4576-9c9d-50d6234c8583@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace news.uni-berlin.de 5w0IX2drrkCzR5lGhQ/prgtyUSAEC2oR+UumajnA/75w==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'repeated': 0.07; 'subject:form': 0.07; 'suffix': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'syntax': 0.13; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'redundant.': 0.16; 'subject:values': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.16; 'trying': 0.22; 'seems': 0.23; 'import': 0.24; 'header:User- Agent:1': 0.26; 'subject:list': 0.26; 'header:X-Complaints-To:1': 0.26; 'idea': 0.28; 'actual': 0.28; 'looks': 0.29; 'colon': 0.29; 'question:': 0.29; 'code': 0.30; 'file': 0.34; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'missing': 0.37; 'names': 0.38; 'end': 0.39; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.62; 'subject:get': 0.81
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host p57bd9414.dip0.t-ipconnect.de
User-Agent KNode/4.13.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21rc2
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:103291

Show key headers only | View raw


davidbenny2000@gmail.com wrote:

>   File "mainpy.py", line 81
>     for functionlistelement in functionlist0
>                                            ^
> SyntaxError: invalid syntax
> 
> 
> import asyncio

[snip]

> mappedfunc = {}
> functionlist000 = []
> functionlist001 = []
> functionlist002 = []
> functionlist003 = []
> functionlist004 = []

[snip many names with numeric suffix and repeated method calls]

I have no idea what you are trying to do; however, your code looks awfully 
redundant. This is errorprone:

functionkey000 = {'000': f000 }
functionkey001 = {'001': f001 }
functionkey002 = {'002': f002 }
functionkey002 = {'003': f003 }
functionkey002 = {'004': f004 }

>   for functionlistelement in functionlist0

To answer what seems to be your actual question: a colon is missing at the 
end of this line.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to get the list form dictionary's values davidbenny2000@gmail.com - 2016-02-21 05:34 -0800
  Re: how to get the list form dictionary's values Chris Angelico <rosuav@gmail.com> - 2016-02-22 01:04 +1100
    Re: how to get the list form dictionary's values Ho Yeung Lee <davidbenny2000@gmail.com> - 2016-02-21 06:15 -0800
      Re: how to get the list form dictionary's values Chris Angelico <rosuav@gmail.com> - 2016-02-22 02:01 +1100
        Re: how to get the list form dictionary's values Marko Rauhamaa <marko@pacujo.net> - 2016-02-21 17:16 +0200
  Re: how to get the list form dictionary's values Peter Otten <__peter__@web.de> - 2016-02-21 15:06 +0100
    Re: how to get the list form dictionary's values Ho Yeung Lee <davidbenny2000@gmail.com> - 2016-02-21 06:21 -0800

csiph-web