More random python observations from a perl programmer
Moritz Moeller-Herrmann
moritz at news.uni-mannheim.de
Thu Aug 19 18:09:53 EDT 1999
On 19 Aug 1999 10:30:51 -0700, Tom Christiansen <tchrist at mox.perl.com> wrote:
[...]
>>There are 'raw' strings though, 'r"<string>"', that dont do backslashes.
>Those aren't the book, and there are no manpages. Therefore,
>in many ways, they don't really count. I know it hurts to hear
>this, and you're all going to jump on me, but please please think
>about it for a bit before you do so.
>>> GOTCHA: (high)
>>> Python has no manpages! The horror!!!!!!!!!!!!!!!!!!!!!!
>>> ENODOC
>>
>>Damn, i hadn't even noticed that. Can you imagine ? I guess the '__doc__'
>>attributes on objects are enough manpage for me. ;)
>It's unconscionable. Lack of tools and the tool-based
>approach strikes again. See other postings.
[...]
>That's not a fricking manpage. How can I run "apropos copy"
>on it? How do I do
> grep copy /usrpython/man/*/*.*
>or
> find /usrpython/man -print | xargs grep copy /dev/null
>or
> troff -man /usrpython/man/man3/copy.3py
>etc etc. Tools, man. Man tools. Flexible interchangeable
>parts.
[...]
Actually, there are excellent html docs. And I found raw strings easily.
grep -3 "raw strings" python-doc/html/*/*.html
python-doc/html/lib/node66.html-subsequent character are included in the resulting string. However,
python-doc/html/lib/node66.html-if Python would recognize the resulting sequence, the backslash should
python-doc/html/lib/node66.html-be repeated twice. This is complicated and hard to understand, so
python-doc/html/lib/node66.html:it's highly recommended that you use raw strings for all but the
python-doc/html/lib/node66.html-simplest expressions.
python-doc/html/lib/node66.html-<DT><tt>[]</tt>
python-doc/html/lib/node66.html-<DD>Used to indicate a set of characters. Characters can
python-doc/html/ref/ref-4.html-longstringchar: <any ASCII character except
"\">
python-doc/html/ref/ref-4.html-escapeseq: "\" <any ASCII
character>
python-doc/html/ref/ref-4.html-</PRE>
python-doc/html/ref/ref-4.html: In plain English: String literals can
be enclosed in single <A NAME=MARKER-2-51></A>quotes (') or double quotes
("). They can also be enclosed in groups of three single or double quotes
(these are generally referred to as <I><A NAME=MARKER-2-52></A>triple-quoted
strings</I>). The <A NAME=MARKER-2-53></A>backslash (\) character is used to
escape characters that otherwise have a special meaning, such as newline,
backslash itself, or the quote character. String literals may optionally be
prefixed with a letter 'r' or 'R'; such strings are called <I>raw strings</I>
and use different rules for backslash escape sequences.<P>
python-doc/html/ref/ref-4.html- In "long strings" (strings surrounded by sets
of three quotes), unescaped newlines and quotes are allowed (and are
retained), except that three unescaped quotes in a row terminate the string.
(A "quote" is the character used to open the string, i.e. either ' or
".)<P>
python-doc/html/ref/ref-4.html- <A NAME=MARKER-2-54></A>Unless an 'r' or 'R'
prefix is present, escape sequences in strings are interpreted according to
rules similar to those used by Standard <A NAME=MARKER-2-55></A>C. The
recognized escape sequences are:
python-doc/html/ref/ref-4.html-<TABLE BORDER="1">
I fail to see why lynx and grep don't work :-)
--
Moritz Moeller-Herrmann mmh at gmx.net ICQ# 3585990 # Not only
Get my public pgp / gpg key from # Open Source(TM)
http://webrum.uni-mannheim.de/jura/moritzpubkeymoritz # but also
KDE forever! Use Linux to impress your friends! # Open Minded!
More information about the Python-list
mailing list