Re: How Do I get Know What Attributes/Functions In A Class?
Use the dir() function dir(myClass) returns a list of strings -Dan -- http://mail.python.org/mailman/listinfo/python-list
Re: How Do I get Know What Attributes/Functions In A Class?
Thank you All ! -- http://mail.python.org/mailman/listinfo/python-list
Re: How Do I get Know What Attributes/Functions In A Class?
Hans Nowak wrote: [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. Or use 'help' (which is build on top of inspect): >>> from smtplib import SMTP >>> help(SMTP) Help on class SMTP in module smtplib: class SMTP | This class manages a connection to an SMTP or ESMTP server. | SMTP Objects: | SMTP objects have the following attributes: | helo_resp | This is the message given by the server in response to the | most recent HELO command. etc. Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: How Do I get Know What Attributes/Functions In A Class?
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thank you Hans. Could you give me a simple sample of using inspect? > http://www.python.org/doc/current/lib/module-inspect.html George -- http://mail.python.org/mailman/listinfo/python-list
Re: How Do I get Know What Attributes/Functions In A Class?
Thank you Hans. Could you give me a simple sample of using inspect? -- http://mail.python.org/mailman/listinfo/python-list
Re: How Do I get Know What Attributes/Functions In A Class?
[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
How Do I get Know What Attributes/Functions In A Class?
Hi, I'm new to python. Given a class, how can I get know what attributes/functins in it without dig into the source? - narke -- http://mail.python.org/mailman/listinfo/python-list