Hi,<br><br><div class="gmail_quote">On 29 September 2011 16:39, lina <span dir="ltr"><<a href="mailto:lina.lastname@gmail.com">lina.lastname@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Or you can get lines 24-28, with text[24, 29] (look up slices in the Python doc)<br>
</blockquote></div></div></div></blockquote><div><br>Dave probably meant: text[24:29]<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"></blockquote></div></div><div><br> >>> print splitext.__doc__<br>
Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br>
NameError: name 'splitext' is not defined<br>>>> print slices.__doc__<br>Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br>NameError: name 'slices' is not defined<br>
>>> print slices._doc_<br>Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br>NameError: name 'slices' is not defined<br></div></div></blockquote><div><br>
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:<br>
<br>>>> import os.path<br>>>> help (os.path.splitext)<br>Help on function splitext in module ntpath:<br><br>splitext(p)<br> Split the extension from a pathname.<br> <br> Extension is everything from the last dot to the end, ignoring<br>
leading dots. Returns "(root, ext)"; ext may be empty.<br><br>>>> <br><br>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.)<br>
<br>Walter<br><br><br></div></div>