Hi,
On 29 September 2011 16:39, lina <[email protected]> wrote:
>
> Or you can get lines 24-28, with text[24, 29] (look up slices in the
>> Python doc)
>>
>
Dave probably meant: text[24:29]
> >>> print splitext.__doc__
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> NameError: name 'splitext' is not defined
> >>> print slices.__doc__
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> NameError: name 'slices' is not defined
> >>> print slices._doc_
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> NameError: name 'slices' is not defined
>
You should probably be looking in the documentation, not trying to feed it
into the interpreter. (If you want to get help on a specific entity in
Python it's usually better to use the "help()" function, e.g:
>>> import os.path
>>> help (os.path.splitext)
Help on function splitext in module ntpath:
splitext(p)
Split the extension from a pathname.
Extension is everything from the last dot to the end, ignoring
leading dots. Returns "(root, ext)"; ext may be empty.
>>>
Note, trying to do "help(os.path.splitext)" would not have worked before I
imported the "os.path" module. (Differently put: Whatever you want to get
help() on, must be known to the interpreter, so must either be built in or
previously imported.)
Walter
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor