what is self?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paul h

    what is self?

    hi there,
    i've been programming cgi with python for a couple of months now, and
    i am now moving into some gui programming, using pygtk2.
    looking into the code, i see a lot of references to "self" ie
    self.window = ...
    however, i have no idea what self is?
    can anyone enlighten me...
    thanks very much...

    --
    paul
  • Bruno Desthuilliers

    #2
    Re: what is self?

    paul h wrote:[color=blue]
    > hi there,
    > i've been programming cgi with python for a couple of months now, and
    > i am now moving into some gui programming, using pygtk2.
    > looking into the code, i see a lot of references to "self" ie
    > self.window = ...
    > however, i have no idea what self is?
    > can anyone enlighten me...
    > thanks very much...
    >[/color]

    self is the current object (read : class instance). I think you should
    read the part about oop support in the python manual.

    Bruno

    Comment

    • Ben Finney

      #3
      Re: what is self?

      On 2 Jul 2003 09:46:32 -0700, paul h wrote:[color=blue]
      > however, i have no idea what self is?[/color]

      You haven't read through the tutorial then.

      Please do so now, it will fill in many missing pieces of knowledge you
      currently have about Python:

      <http://python.org/doc/current/tut/>

      --
      \ "Either he's dead or my watch has stopped." -- Groucho Marx |
      `\ |
      _o__) |
      http://bignose.squidly.org/ 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B

      Comment

      • Ben Finney

        #4
        Re: what is self?

        On 2 Jul 2003 09:46:32 -0700, paul h wrote:[color=blue]
        > however, i have no idea what self is?[/color]

        You haven't read through the tutorial then.

        Please do so now, it will fill in many missing pieces of knowledge you
        currently have about Python:

        <http://python.org/doc/current/tut/>

        --
        \ "Either he's dead or my watch has stopped." -- Groucho Marx |
        `\ |
        _o__) |
        http://bignose.squidly.org/ 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B

        Comment

        Working...