Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37965
| References | <cf3b0f42-a133-45df-b1c8-8291b1896878@googlegroups.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2013-01-30 15:08 -0700 |
| Subject | Re: help |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1231.1359583775.2939.python-list@python.org> (permalink) |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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