absolute beginners question about API documentation

holger krekel pyth at devel.trillke.net
Sun Jul 6 17:58:48 EDT 2003


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?

<shameless plug>

Python has this nice interactive command line (others already
showed how to get to "method names" and such). 

As you seem to be using linux you may want to try the "rlcompleter2.py"
module which provides bash-like <tab> completion on arbitrary python 
objects ...

    http://codespeak.net/rlcompleter2 

... this would give you ...

>>> {}.<tab>
*                      <bui>get*(1-2)         <bui>iteritems*()
<bui>keys*()           <bui>update*(1)        <bui>clear*()          
<bui>has_key*(1)       <bui>iterkeys*()       <bui>popitem*()        
<bui>values*()         <bui>copy*()           <bui>items*()          
<bui>itervalues*()     <bui>setdefault*(1-2)

and hitting it another time

>>> {}.<tab>
<bui>clear*()      -> None.  Remove all items from D.
<bui>copy*()       -> a shallow copy of D
<bui>get*(1-2)     -> D[k] if D.has_key(k), else d.  d defaults to None.
<bui>has_key*(1)   -> 1 if D has a key k, else 0
<bui>items*()      -> list of D's (key, value) pairs, as 2-tuples
<bui>iteritems*()  -> an iterator over the (key, value) items of D
<bui>iterkeys*()   -> an iterator over the keys of D
<bui>itervalues*() -> an iterator over the values of D
<bui>keys*()       -> list of D's keys
<bui>popitem*()    -> (k, v), remove and return some (key, value) pair
as a. 2-tuple; but raise KeyError if D is empty
<bui>setdefault*(1-2) -> D.get(k,d), also set D[k]=d if not D.has_key(k)
<bui>update*(1)    -> None.  Update D from E: for k in E.keys(): D[k] =
E[k]
<bui>values*()     -> list of D's values

and going to a specific function

>>> {}.get(<tab>
------------------------------------------------------------------------------
D.get(k[,d]) -> D[k] if D.has_key(k), else d.  d defaults to None.

and so on.

</shameless plug>

cheers,

    holger





More information about the Python-list mailing list