[Baypiggies] How to find the constants availiabe for a given module
Kevin Wright
akwright at mac.com
Tue Feb 16 03:42:12 CET 2010
BTW,
You can perform the help() and dir() without importing:
>>> help('string')
>>> dir('string')
you just need to quote the library you are looking for info on.
--Kevin
On Feb 15, 2010, at 6:29 PM, Alfred Appiah wrote:
> Ahh ok I see why it was not working when I was running
> 'help(string)' / 'dir(string)' etc and getting the message below .
>
> "NameError: name 'string' is not defined"..I forgot to add "import
> string"
>
> works now .
> cheers Al
>
> --- On Mon, 2/15/10, Alan Westbrook <voidref at gmail.com> wrote:
>
>> From: Alan Westbrook <voidref at gmail.com>
>> Subject: Re: [Baypiggies] How to find the constants availiabe for a
>> given module
>> To: aappiah at yahoo.com
>> Cc: baypiggies at python.org
>> Date: Monday, February 15, 2010, 6:12 PM
>> Oh, also
>>
>> help(string)
>>
>> On Mon, Feb 15, 2010 at 6:12 PM, Alan Westbrook <voidref at gmail.com>
>> wrote:
>>> dir(string) might be what you are looking for.
>>>
>>> On Mon, Feb 15, 2010 at 6:09 PM, Alfred Appiah <aappiah at yahoo.com>
>> wrote:
>>>> Hi,
>>>>
>>>> I am new to python and wanted to know if there a
>> way to find out all the constants, functions and classes
>> available for a given module.
>>>>
>>>> For example the string module supports the
>> following constants and functions,
>>>>
>>>> string.letters,
>>>> string.digits
>>>> string.whitespace
>>>> string.capwords()
>>>>
>>>> and the only way I have been able to find out the
>> classes and functions available is by reading the python
>> docs , I.E http://docs.python.org/library/string.html . Are there
>> commands I can type in the interpreter to get this
>> information also ?
>>>>
>>>> Cheers Alfred
>>>> _______________________________________________
More information about the Baypiggies
mailing list