Re: Class confusion

Discussion in 'Python' started by MRAB, Jan 9, 2013.

  1. MRAB

    MRAB Guest

    On 2013-01-09 20:13, Rodrick Brown wrote:
    > How can I make a class that has methods with attributes and other
    > functions?
    > I see a lot of code
    >
    >
    > I'm reading the documentation to Redhat's Satellite software which has a
    > XMLRPC interface and wrote the following code to test the api.
    >
    > I would like to extend this code to support methods with methods? I see
    > this done a lot in python code but I'm not sure how to accomplish
    > something like this?
    >
    > i.e.
    >
    > sc = SatelliteConnect()
    > sc.get_systemlist().get_systemid() ?
    > or
    > sc.get_systemlist().get_running_kernel()
    >
    > How does one chain methods and attributes like this with classes?
    >

    [snip]
    This:

    sc.get_systemlist().get_systemid()

    simply means that the method "get_systemlist" returns an instance of
    some class (let's call it "SystemList") which has a method
    "get_systemid".
     
    MRAB, Jan 9, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,792
    Thomas Weidenfeller
    Oct 12, 2005
  2. Fao, Sean

    Class Confusion

    Fao, Sean, Sep 1, 2004, in forum: C++
    Replies:
    4
    Views:
    436
    Fao, Sean
    Sep 2, 2004
  3. christopher diggins
    Replies:
    16
    Views:
    756
    Pete Becker
    May 4, 2005
  4. Cndistin
    Replies:
    3
    Views:
    266
    Pierre Quentel
    Jan 6, 2004
  5. Joseph Turian
    Replies:
    5
    Views:
    598
Loading...

Share This Page