absolute beginners question about API documentation

Discussion in 'Python' started by Markus Joschko, Jul 6, 2003.

  1. Hi all,
    I' new to python programming but a longtime java programmer.
    Is there an API documentation like the javadoc API from java?

    I'm want to know all methods I can use on dictionaries. Where can I get an
    overview about these?
    I looked on python.org but haven't found such an overview.

    Thanks,
    Markus
     
    Markus Joschko, Jul 6, 2003
    #1
    1. Advertising

  2. Markus Joschko

    Dave Kuhlman Guest

    Markus Joschko wrote:

    > Hi all,
    > I' new to python programming but a longtime java programmer.
    > Is there an API documentation like the javadoc API from java?
    >
    > I'm want to know all methods I can use on dictionaries. Where can
    > I get an overview about these?
    > I looked on python.org but haven't found such an overview.
    >


    If you are asking about the *Python* API, then look here:

    http://www.python.org/doc/current/lib/typesmapping.html

    If you are asking about the C API (which is less likely but
    possible), then look here:

    http://www.python.org/doc/current/api/dictObjects.html

    Hope this helps.

    - Dave

    --
    Dave Kuhlman
    http://www.rexx.com/~dkuhlman
     
    Dave Kuhlman, Jul 6, 2003
    #2
    1. Advertising

  3. Dave Kuhlman wrote:

    > Markus Joschko wrote:
    >
    >> Hi all,
    >> I' new to python programming but a longtime java programmer.
    >> Is there an API documentation like the javadoc API from java?
    >>
    >> I'm want to know all methods I can use on dictionaries. Where can
    >> I get an overview about these?
    >> I looked on python.org but haven't found such an overview.
    >>

    >
    > If you are asking about the *Python* API, then look here:
    >
    > http://www.python.org/doc/current/lib/typesmapping.html
    >


    Thanks. That's it. I hadn't suspect it there.
     
    Markus Joschko, Jul 6, 2003
    #3
  4. Dave Kuhlman wrote:
    > Markus Joschko wrote:
    >>I'm want to know all methods I can use on dictionaries. Where can
    >>I get an overview about these?
    >>I looked on python.org but haven't found such an overview.

    > If you are asking about the *Python* API, then look here:
    > http://www.python.org/doc/current/lib/typesmapping.html
    > If you are asking about the C API (which is less likely but
    > possible), then look here:
    >
    > http://www.python.org/doc/current/api/dictObjects.html


    Maybe one should add for better comprehension that dictionaries in
    python are builtin types.

    So when you look for them in documentation, you should look into the
    basics and not for some Standard Library class as you would in the Java
    world.

    Hope it helps,
    Ben.
     
    Behrang Dadsetan, Jul 6, 2003
    #4
  5. Markus Joschko

    Alan Kennedy Guest

    Markus Joschko wrote:

    >>> Is there an API documentation like the javadoc API from java?


    Dave Kuhlman wrote:

    >> If you are asking about the *Python* API, then look here:
    >>
    >> http://www.python.org/doc/current/lib/typesmapping.html


    Markus Joschko wrote:

    > Thanks. That's it. I hadn't suspect it there.


    And don't forget the interactive help available on most objects,
    through the use of the dir() and help() functions, e.g.

    Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> d = {}
    >>> dir(d)

    ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__',
    '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__',
    '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
    '__lt__', '__ne__', '__new__', '__reduce__', '__repr__',
    '__setattr__',
    '__setitem__', '__str__', 'clear', 'copy', 'get', 'has_key', 'items',
    'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem',
    'setdefault',
    'update', 'values']
    >>> help(d.keys)

    Help on built-in function keys:

    keys(...)
    D.keys() -> list of D's keys

    >>> help(d.has_key)

    Help on built-in function has_key:

    has_key(...)
    D.has_key(k) -> 1 if D has a key k, else 0

    >>>


    HTH,

    --
    alan kennedy
    -----------------------------------------------------
    check http headers here: http://xhaus.com/headers
    email alan: http://xhaus.com/mailto/alan
     
    Alan Kennedy, Jul 6, 2003
    #5
  6. Markus Joschko

    Alan Kennedy Guest

    Dave Kuhlman wrote:

    > If you are asking about the *Python* API, then look here:
    >
    > http://www.python.org/doc/current/lib/typesmapping.html
    >
    > If you are asking about the C API (which is less likely but
    > possible), then look here:
    >
    > http://www.python.org/doc/current/api/dictObjects.html


    I think that for completeness, and given the OPs java background, it's
    probably worth mentioning the Java API to the jython interpreter as
    well

    http://www.jython.org/docs/javadoc/index.html

    --
    alan kennedy
    -----------------------------------------------------
    check http headers here: http://xhaus.com/headers
    email alan: http://xhaus.com/mailto/alan
     
    Alan Kennedy, Jul 6, 2003
    #6
  7. Markus Joschko

    Ian Bicking Guest

    On Sun, 2003-07-06 at 12:44, Markus Joschko wrote:
    > Hi all,
    > I' new to python programming but a longtime java programmer.
    > Is there an API documentation like the javadoc API from java?


    http://python.org/doc/ , of course.

    > I'm want to know all methods I can use on dictionaries. Where can I get an
    > overview about these?


    You want to look at the Library Reference, in the built-in type section
    (mapping types). You can also try:

    >>> dir({})

    ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__',
    '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__',
    '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
    '__lt__', '__ne__', '__new__', '__reduce__', '__repr__', '__setattr__',
    '__setitem__', '__str__', 'clear', 'copy', 'get', 'has_key', 'items',
    'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem', 'setdefault',
    'update', 'values']
    >>> help({}.update)

    Help on built-in function update:

    update(...)
    D.update(E) -> None. Update D from E: for k in E.keys(): D[k] =
    E[k]
     
    Ian Bicking, Jul 6, 2003
    #7
  8. | Hi all,
    | I' new to python programming but a longtime java programmer.
    | Is there an API documentation like the javadoc API from java?
    | ...

    Markus ...

    I find the pydoc module handy for helping
    to find Python information ...

    The following command line starts pydoc
    with a small GUI as a Python documentation server
    with search and browse options ...

    python YourPythonPath/Lib/pydoc.py -g

    The browse option is useful because it also lists
    docs for any installed site-packages ...

    --
    Cousin Stanley
    Human Being
    Phoenix, Arizona
     
    Cousin Stanley, Jul 6, 2003
    #8
    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. Michael Washington
    Replies:
    0
    Views:
    518
    Michael Washington
    Oct 12, 2004
  2. Clodoaldo Pinto

    Programming Tutorial for absolute beginners

    Clodoaldo Pinto, Apr 7, 2006, in forum: Python
    Replies:
    26
    Views:
    966
    Clodoaldo Pinto
    Apr 11, 2006
  3. harrismh777
    Replies:
    2
    Views:
    546
    harrismh777
    Jul 28, 2011
  4. Patty
    Replies:
    0
    Views:
    204
    Patty
    Jul 28, 2011
  5. James Byrne
    Replies:
    3
    Views:
    580
    James Byrne
    Sep 14, 2010
Loading...

Share This Page