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

Chris Angelico rosuav at gmail.com
Thu Sep 6 09:16:26 EDT 2012


On Thu, Sep 6, 2012 at 10:07 PM, shaun <shaun.wiseman91 at 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



More information about the Python-list mailing list