[EMAIL PROTECTED] wrote:
Hi,

I'm new to python.  Given a class, how can I get know what
attributes/functins in it without dig into the source?

Use the dir function:

>>> from smtplib import SMTP
>>> dir(SMTP)
['__doc__', '__init__', '__module__', 'close', 'connect', 'data', 'debuglevel', 'docmd', 'does_esmtp', 'ehlo', 'ehlo_resp', 'expn', 'file', 'getreply', 'has_extn', 'helo', 'helo_resp', 'help', 'login', 'mail', 'noop', 'putcmd', 'quit', 'rcpt', 'rset', 'send', 'sendmail', 'set_debuglevel', 'starttls', 'verify', 'vrfy']


To get more detailed information than just a list of names, see the inspect module.

--
Hans Nowak
http://zephyrfalcon.org/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to