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


Groups > comp.lang.python > #37965

Re: help

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'context': 0.05; 'everyone!': 0.07; 'subject:help': 0.07; 'python': 0.09; 'global,': 0.09; 'scope.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'obviously': 0.18; 'module': 0.19; 'code.': 0.20; 'trying': 0.21; 'stick': 0.22; "i'd": 0.22; 'statement': 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'lines': 0.28; 'run': 0.28; 'surprised': 0.29; 'knows': 0.30; 'function': 0.30; 'error': 0.30; 'helpful': 0.30; 'to:addr:python- list': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'said,': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; "didn't": 0.36; 'level': 0.37; 'being': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; '30,': 0.62; 'within': 0.64; 'great': 0.64; '2013': 0.84; 'dict()': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=jD/lT/bauMzaeYL5CdislVSvY47HuwW2V14wcSkw1pg=; b=bOGduywMaV09TJ+Od7v05IsCePsYgXqXI2UC0nkv9PDhXeJnCCW3vTDB/LAmNA+6vJ 8M1nCHF941no0IMbPfMT0QjqAlF5d8wMY/X3gqJdO5mTmUDGm3hkg7FZaUHToCtN69Un /7CCKS4QJeFOvhgRFE1hMa79HTzkhg5UigSCzkVL9jZCZvdtATr1WjJ0KB8O+64eKk5g Lzdjk3gbTLPIXRUKg/9jd0NXig+Iig1X/xNCc2FBTw7k5l0COUTKpq6PCYfPibjLNtOo iCXtjlGdIaQVmQGhJOp8HZ9HLtETtYJNy1Vvp6Q7VrGP+eSoNrX6d07CJo4/doPipsPG 2uvw==
X-Received by 10.68.248.70 with SMTP id yk6mr16016113pbc.160.1359583767382; Wed, 30 Jan 2013 14:09:27 -0800 (PST)
MIME-Version 1.0
In-Reply-To <cf3b0f42-a133-45df-b1c8-8291b1896878@googlegroups.com>
References <cf3b0f42-a133-45df-b1c8-8291b1896878@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Wed, 30 Jan 2013 15:08:57 -0700
Subject Re: help
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1231.1359583775.2939.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359583775 news.xs4all.nl 6906 [2001:888:2000:d::a6]:41737
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37965

Show key headers only | View raw


On Wed, Jan 30, 2013 at 2:16 PM,  <aramildaern@gmail.com> wrote:
> Hi everyone! I don't mean to intrude, but ive heard great things about this group and ive stumped myself with my python code.
>
> heres my code:

It would be helpful if you would also include the error that you get
when trying to run the code.

> global labelList
> labelList= dict()
>
> global counter
> counter = 0

That said, these lines stick out as being obviously wrong.  The global
statement is used within the context of a function to declare that a
name used within that function has global scope rather than local
scope.  There is no meaning to using the statement at the module level
like this -- Python already knows the name is global, because it's not
being used within a function -- and I'd be surprised if this didn't
result in a SyntaxError.

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


Thread

help aramildaern@gmail.com - 2013-01-30 13:16 -0800
  Re: help Ian Kelly <ian.g.kelly@gmail.com> - 2013-01-30 15:08 -0700
  Re: help Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-30 17:09 -0500
  Re: help Chris Angelico <rosuav@gmail.com> - 2013-01-31 09:20 +1100
  Re: help Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-31 13:42 +1100
  Re: help Dave Angel <d@davea.name> - 2013-01-30 22:13 -0500

csiph-web