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:02:01 -0700 Lines: 23 Message-ID: References: <1462163501.1158885.595255233.34023BE4@webmail.messagingengine.com> <1462165321.1165390.595267481.3403F202@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de mV4Cl7UsFNJKt7JXxo7ztgVkXkfmXTOZvYWR/C2RaqhA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'paths': 0.05; 'escape': 0.07; 'received:internal': 0.09; 'subject:python': 0.14; 'dfs': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:compute4.internal': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'slashes': 0.16; 'urllib': 0.16; 'wrote:': 0.16; 'thanks.': 0.18; 'windows': 0.20; 'file:': 0.22; 'stephen': 0.22; 'am,': 0.23; 'code.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'raw': 0.27; 'skip:u 20': 0.28; 'that.': 0.30; 'skip:- 30': 0.32; 'point': 0.33; 'skip:/ 20': 0.33; 'but': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'really': 0.37; 'received:66': 0.38; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'save': 0.60; 'header:Message-Id:1': 0.61; 'webpage': 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=GCJ/fUbpgK/PaHVDxx61I01JR+g=; b=bQh650 yMQqMJaI0O/EXfDiv0T+kLDcyuaoa9jzPRb4cs35MTZh+vPHiFD03q6b+8aOMy5W mmivSeTu+i76uSOKi2bcncnEdNZY0FmBonmN6kqhiRU0rk6PQwo/w3S0VSknUl/o hpmyzgN5SLeZM/Z5rrsjX02mcYSBluPwaL6nI= 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=GCJ/fUbpgK/PaHV Dxx61I01JR+g=; b=U154sDIw1Vjav5sYRc2rudGOq8Ji1fevhld6c4x9gp5+6Fy t47Hv7WYJSmpyHim2AH7l4BsMbt2Puufm6BBjeZQoywzv74piuknVUN729rQBH2f XIT4F7Ba4aD8NI7tmYLXvd80mBgm6c0eR2refboWl/9d15aPo9TYJ603J5FE= X-Sasl-Enc: xC2OUPWBPI/hRXl6z677nsEm3lWYVff2n4ld+gpENqUa 1462165321 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: <1462165321.1165390.595267481.3403F202@webmail.messagingengine.com> X-Mailman-Original-References: <1462163501.1158885.595255233.34023BE4@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:107977 On Sun, May 1, 2016, at 09:51 PM, DFS wrote: > On 5/2/2016 12:31 AM, Stephen Hansen wrote: > > On Sun, May 1, 2016, at 08:39 PM, DFS wrote: > >> To save a webpage to a file: > >> ------------------------------------- > >> 1. import urllib > >> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com > >> /ex/001.html","D:\file.html") > >> ------------------------------------- > > > > Note, for paths on windows you really want to use a rawstring. Ie, > > r"D:\file.html". > > > Thanks. > > 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 :) -- Stephen Hansen m e @ i x o k a i . i o