Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'string': 0.09; 'literal': 0.09; 'subject:How': 0.10; 'backslashes': 0.16; 'subject:mirror': 0.16; 'syntaxerror:': 0.16; 'url:faq': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'to:name:python-list@python.org': 0.22; 'tim': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; 'work:': 0.31; 'file': 0.32; 'another': 0.32; 'url:python': 0.33; 'raw': 0.33; 'subject: (': 0.35; 'subject:with': 0.35; "can't": 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'url:3': 0.61; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=wBt5uAk+vVaOulapSQudmi5FDcYKhtBOEicLfE+Crwo=; b=R4ygkSx3hwn/HvDzKMjrSFGfb9OvFU1cbCnNmCLRuLlDVIkePqwdy6JR+aCS5EaJ44 h3/z74Wb7woGPlw1lsD6wB7lJxMIoWj/blMtx1kDcknB5M0icqqpj2V3vUEqoWMWLlBs U9Yg/DgW7ETRBGT8iPS8HtKDW7znETnMMFXwgwHiBDxR48cqdJA3XRH2wO40Vr0Erfe5 xaDLDoisiDrFJyVdtya5vBel7hACFFKquKR6zmyIUka6L49xTIMYtV3XzUI8BKvPWjbV IvN8JVelmFNkl6W359vRjE/pfpKXPAnyhDU0M14wBtnvQnuG/R0i3uPSgwgcqTkTsSwD fb2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:content-type; bh=wBt5uAk+vVaOulapSQudmi5FDcYKhtBOEicLfE+Crwo=; b=PLgdrGEiPN4mxmAQDW423DzBN/0JRPO2ngT4UtCFiKkGg3FhCQ6daU/X48uczHAz0w mj9IkQUJZQf6MwSL0iBqjGm8dkuSVYCv3Dd7CO2v0UlOeksRU0M8z6WpaZ8uVNwpz53o pBPLwuTyhVIUnTo7N5LLc9hel6wOQbuAANDynKzYWFALtSu7s2Hs7lNbxfVIR9BfZTVB IF36LkaBZJ9XjOJcG57Oxc3woXFkd+kKJlG+jznjWrB9QI0gJM6yKs3LQD4BWCLXP2mc pR3H7WvCQWoe7p1S62dMyU9xPM8I2dX1Ju4Oi3QotGvs9KN4F926NZTBtVCPLlgw+Cwf PeSA== X-Gm-Message-State: ALoCoQmF9IU9yRq24gM4UIsD1xXvKLHpjRLQcfOpdNEoAZDsYPEJdqnvqf/nfNjB0h01BMrkO4e5 X-Received: by 10.180.208.7 with SMTP id ma7mr9345776wic.25.1378092160081; Sun, 01 Sep 2013 20:22:40 -0700 (PDT) MIME-Version: 1.0 Sender: z@etiol.net X-Originating-IP: [190.47.101.237] From: Zero Piraeus Date: Sun, 1 Sep 2013 23:22:20 -0400 X-Google-Sender-Auth: dLWuDPEDh7zspILnzjF4Yu-Hk2I Subject: Re: How to split with "\" character, and licence copyleft mirror of (c) To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378092168 news.xs4all.nl 15901 [2001:888:2000:d::a6]:53608 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53452 : On 1 September 2013 22:40, Tim Roberts wrote: > Another altrnative is to use "raw" strings, in which backslashes are not > interpreted: > a = r'E:\Dropbox\jjfsdjjsdklfj\sdfjksdfkjslkj\flute.wav' > a.split(r'\') Acually, that doesn't work: >>> a = r'E:\Dropbox\jjfsdjjsdklfj\sdfjksdfkjslkj\flute.wav' >>> a.split('\') File "", line 1 a.split('\') ^ SyntaxError: EOL while scanning string literal ... because you can't end a raw string with a backslash: http://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash -[]z.