Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17955 > unrolled thread

Re: Backslash Escapes

Started byLie Ryan <lie.1296@gmail.com>
First post2011-12-26 20:36 +1100
Last post2011-12-26 20:36 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Backslash Escapes Lie Ryan <lie.1296@gmail.com> - 2011-12-26 20:36 +1100

#17955 — Re: Backslash Escapes

FromLie Ryan <lie.1296@gmail.com>
Date2011-12-26 20:36 +1100
SubjectRe: Backslash Escapes
Message-ID<mailman.4100.1324892219.27778.python-list@python.org>
On 12/26/2011 12:04 PM, Felipe O wrote:
> Hi all,
> Whenever I take any input (raw_input, of course!) or I read from a
> file, etc., any backslashes get escaped automatically.

Python never escapes backslashes when reading from raw_input or files. 
Python only ever escapes backslashes when displaying data on the 
interactive shell since the interactive shell uses __repr__ by default.

> Is there any
> elegant way of parsing the backslashes as though they were written in
> a python string. The best I have so far right now goes like this:

You shouldn't ever need to unless your file are backslash-escaped.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web