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


Groups > comp.lang.python > #28587

Re: Need help fixing this error please:NameError: global name is not defined

References <149e9472-ec31-4b74-9f20-d4945a9fb678@googlegroups.com> <1c670c04-4367-4518-aa50-cf9adad8f6d2@googlegroups.com>
Date 2012-09-06 23:16 +1000
Subject Re: Need help fixing this error please:NameError: global name is not defined
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.300.1346937389.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 6, 2012 at 10:07 PM, shaun <shaun.wiseman91@gmail.com> wrote:
> Hi Chris,
>
>      I'm changing it into multiple classes because the script is going to get much larger its more for maintainability reasons rather than functionality reasons.

Doesn't necessarily have to be multiple classes. Python gives you the
flexibility of dividing things in whatever way makes sense to your
project. Maybe a class is right - I can't say without seeing all your
code and knowing all your intentions - but if it's not, you don't have
to feel constrained by it. This isn't Java where all code goes into a
class!

> Thanks so much man it was the "self" fix you stated above. I woe you a pint of Guinness :D

You're welcome! I'm a non-drinker, though, so you can drink it and
think of me. :)

ChrisA

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


Thread

Need help fixing this error please:NameError: global name is not defined shaun <shaun.wiseman91@gmail.com> - 2012-09-06 03:45 -0700
  Re: Need help fixing this error please:NameError: global name is not defined Chris Angelico <rosuav@gmail.com> - 2012-09-06 21:05 +1000
  Re: Need help fixing this error please:NameError: global name is not defined Dave Angel <d@davea.name> - 2012-09-06 07:05 -0400
  Re: Need help fixing this error please:NameError: global name is not defined Peter Otten <__peter__@web.de> - 2012-09-06 13:07 +0200
  Re: Need help fixing this error please:NameError: global name is not defined Chris Angelico <rosuav@gmail.com> - 2012-09-06 21:53 +1000
  Re: Need help fixing this error please:NameError: global name is not defined shaun <shaun.wiseman91@gmail.com> - 2012-09-06 05:07 -0700
    Re: Need help fixing this error please:NameError: global name is not defined Chris Angelico <rosuav@gmail.com> - 2012-09-06 23:16 +1000
  Re: Need help fixing this error please:NameError: global name is not defined MRAB <python@mrabarnett.plus.com> - 2012-09-06 13:08 +0100
  Re: Need help fixing this error please:NameError: global name is not defined Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-06 17:16 -0400

csiph-web