Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail From: eryk sun Newsgroups: comp.lang.python Subject: Re: use Python and an outlook: protocol URL to bring up a specific email Date: Tue, 12 Jan 2016 11:37:09 -0600 Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de ZivocLyD3bsHMmpnv24JRAnwRhcwGrcT9LuN4q1tcAGw== 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; 'received:209.85.223': 0.03; 'subject:Python': 0.05; '"%s"\'': 0.09; 'command.': 0.09; 'title.': 0.09; 'jan': 0.11; 'wed,': 0.15; 'argument': 0.15; '2016': 0.16; '3:51': 0.16; 'fwiw': 0.16; 'popping': 0.16; 'quoted': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:URL': 0.16; 'wrote:': 0.16; ';-)': 0.18; 'shell': 0.18; 'windows': 0.20; 'to:name:python-list@python.org': 0.20; 'arguments': 0.22; 'simpler': 0.22; 'am,': 0.23; 'header:In-Reply- To:1': 0.24; 'command': 0.26; 'chris': 0.26; 'equivalent': 0.27; 'message-id:@mail.gmail.com': 0.27; 'said,': 0.27; 'correct': 0.28; '13,': 0.29; 'invoke': 0.29; 'protocol.': 0.29; 'referenced': 0.29; 'code': 0.30; 'window': 0.30; 'skip:s 30': 0.31; 'tue,': 0.34; 'received:google.com': 0.35; 'clear': 0.35; 'subject:use': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; '12,': 0.37; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'some': 0.40; 'secure': 0.60; 'more': 0.63; 'pasting': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Ia6cN005v+w7TKFiSf5+lcuJ7M6bmVyFQMXVNZOn28w=; b=bpg3G5fcpFiHvGb5q0Unwa3Fv5YOw8DZv1NyWxemZNDZ4j8xiz8gIZ8M90LM1WYyRr TbQgP3syLoX2wO1nHwWJ/GZsq4pGhevoIl0m1+yQiG8JSvDBR30NFAoqkJDQ2H2SnSUd yXTkzwsQGAn04vXxIozK1B7+xL7ddhiSHM1swEV5FLiZ7yrjvC+tU/K6ZSzlmp5DIQjW x5+KY9iF/ieD2+lmGRknNHNGGtCbrXpxm7n9Icu7G+xkhwiNDm505UkOMEFanIZ2W0Du yEqaokHmjx5Y+eM9F2cNq+wbeR3oFlddu3GraXvRoNBs/TacRbyOekR3WKP36ymP5lVj OA5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=Ia6cN005v+w7TKFiSf5+lcuJ7M6bmVyFQMXVNZOn28w=; b=XZpjNW0EOFFds1ppPgnV8hB8VAeEIGXzPBO7Rwo0hIw79IIXOt+k5DYTYtXQ6f1NSm 9Sxdr1Be8M5L9Vp6mU2kQjotAx0g0dmlv54CKpraQlKC7l9qHDIjC/BMIHSQqra/TGdn 2yRSfLn60Bzr5G/XkHg8ibZCO4hno/1ev3rrKvR71k4kVsBcWBytCj8MjXaM8KhyJAK9 o7nTbhpxpZGz1GHrS5dPVK6scx8RQNN+kRbFQZdBHF9pYK1ivcRahiVMX1l0Y1NCTFlV hcCKG3uN9bLZDNEDvgvhJiaUgI+eraOO8Rs+Dh79UlAJc5LbbN312TKw9ElbcpVr6+Rr tjPg== X-Gm-Message-State: ALoCoQnbckGwl8KyE+Onnd0MlrFXjBnPjLpFTkSV5tsI2xAkj8RkeAwWrx13g0hV5ZlnnM7XnFsByySzjW0vtI8KCnqKkXl2Iw== X-Received: by 10.107.11.68 with SMTP id v65mr118641352ioi.188.1452620268947; Tue, 12 Jan 2016 09:37:48 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101560 On Tue, Jan 12, 2016 at 11:10 AM, Chris Angelico wrote: > On Wed, Jan 13, 2016 at 3:51 AM, jkn wrote: >> I happy to carve some code without using urllib, but I am not clear what I >> actually need to do to 'open' such a URL using this protocol. FWIW I can paste >> this URL into Windows Explorer and I get the referenced email popping up ;-) > > What happens if you invoke the 'start' command using subprocess? > > subprocess.check_call(["start", url]) > > In theory, that should be equivalent to pasting it into Explorer. In theory. start is a shell command. It also has a quirk that the first quoted argument is the window title. Here's the correct call: subprocess.check_call('start "title" "%s"' % url, shell=True) That said, since no arguments are being passed the simpler and more secure way to call ShellExecute in this case is os.startfile(url).