Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Stephen Hansen Newsgroups: comp.lang.python Subject: Re: You gotta love a 2-line python solution Date: Sun, 01 May 2016 22:21:18 -0700 Lines: 20 Message-ID: References: <1462163501.1158885.595255233.34023BE4@webmail.messagingengine.com> <1462165321.1165390.595267481.3403F202@webmail.messagingengine.com> <1462166478.1168179.595275257.0A4C1AD8@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de R5DoCiRdOJ3/YpFJwDIZIApp+vz20VqXQOPXxdAQpwfw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'escape': 0.07; 'received:internal': 0.09; 'subject:python': 0.14; "'r'": 0.16; 'backslashes': 0.16; 'dfs': 0.16; 'expressions.': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'slashes': 0.16; 'wrote:': 0.16; 'windows': 0.20; 'stephen': 0.22; 'am,': 0.23; 'code.': 0.23; 'header:In-Reply-To:1': 0.24; 'raw': 0.27; 'regular': 0.29; 'anywhere': 0.30; 'that.': 0.30; 'point': 0.33; 'useful': 0.33; 'primarily': 0.35; 'but': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'data': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'header:Message-Id:1': 0.61; 'more': 0.63; "they're": 0.66 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=ixokai.io; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Q8Fl8OjmxENlS9wv/Becg6f8w+M=; b=OUCMLT vFnvbSX8ElvNiLLWKAm3nDwHLSeVOIY+1bOuO8ReYmpDjTSnWQkZJMVwm9rvBxlP Z+ks8wv+j0eEg/re4TG5lxcpqnbMy04rYvF1Pc0In/LBOyflL8dVrK4Mnul3gwqr DVNXWUo9c7wM9UminW5V7ZefNsmCG26nax5KQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Q8Fl8OjmxENlS9w v/Becg6f8w+M=; b=beSRfyxb5n5sxFLhf+4QZb67f/Dx6Q1jJK3dW1EkzBLoINU amiT6+K77MRKEj3m83NmQqsE0Cf+X9pHZY3F1OGcX2sCRbmH+0JXLgzTTOcbOc3P ZM9f32uEUhU2zzd6/8gDHYhebWvQNgnPqKuhOn1lq3clDouogyIG7cdfyakI= X-Sasl-Enc: YY3xH+wu7hnqoVHHYXBohhdTD8zgMIeJvn8hCiA5mtsq 1462166478 X-Mailer: MessagingEngine.com Webmail Interface - ajax-491eb5a4 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1462166478.1168179.595275257.0A4C1AD8@webmail.messagingengine.com> X-Mailman-Original-References: <1462163501.1158885.595255233.34023BE4@webmail.messagingengine.com> <1462165321.1165390.595267481.3403F202@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:107983 On Sun, May 1, 2016, at 10:08 PM, DFS wrote: > On 5/2/2016 1:02 AM, Stephen Hansen wrote: > >> I actually use "D:\\file.html" in my code. > > > > Or you can do that. But the whole point of raw strings is not having to > > escape slashes :) > > > Nice. Where/how else is 'r' used? Raw strings are primarily used A) for windows paths, and more universally, B) for regular expressions. But in theory they're useful anywhere you have static/literal data that might include backslashes where you don't actually intend to use any escape characters. -- Stephen Hansen m e @ i x o k a i . i o