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

2010-03-30 Thread Emile van Sebille

On 3/30/2010 8:23 AM Mike Baker said...

Random Googling shows that there are things like process identification
numbers available - such as proc.pid.  How do I find the other options?


try dir(proc) or help(proc) for starters...

Emile

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


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

2010-03-30 Thread Albert-Jan Roskam
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  wrote:

From: Mike Baker 
Subject: [Tutor] How do I find information about a Python object.
To: tutor@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@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



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


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

2010-03-30 Thread Serdar Tumgoren
You might want to check out the below chapter from Dive Into Python:

http://diveintopython.org/power_of_introspection/index.html
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


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

2010-03-30 Thread Mike Baker
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
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor