[Tutor] How do I find information about a Python object.

Albert-Jan Roskam fomcl at yahoo.com
Tue Mar 30 17:36:47 CEST 2010


Hi,

Are you looking for the inspect module?
 
import inspect
help(inspect)
cls = str
inspect.classify_class_attrs(cls)

Cheers!!

Albert-Jan



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the face of ambiguity, refuse the temptation to guess.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Tue, 3/30/10, Mike Baker <mibaker88 at gmail.com> wrote:

From: Mike Baker <mibaker88 at gmail.com>
Subject: [Tutor] How do I find information about a Python object.
To: tutor at python.org
Date: Tuesday, March 30, 2010, 5:23 PM

Hi,
 
I've downloaded IDLE python for windows.  I've also downloaded Eclipse with the python addition. I have simple programs that will run on both IDLE and Eclipse. How do I get more information about a object/variable, such as proc in the example below.

 
For example, if I execute the following:
    >>> proc = subprocess.Popen(['C:\\Progra~1\\putty\\plink','Catt'],
                        shell=False)
          I can remote log into our Linux machine named 'Catt'.
 
 
How do I find a list of attributes for the object/variable proc?  I've tried subprocess.__doc__ and subprocess.Popen.__doc__.
 
Random Googling shows that there are things like process identification numbers available - such as proc.pid.  How do I find the other options?
 
Thanks,
 
Mike

-----Inline Attachment Follows-----

_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100330/f5380fd7/attachment-0001.html>


More information about the Tutor mailing list