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


Groups > comp.lang.python > #101558

Re: use Python and an outlook: protocol URL to bring up a specific email

Newsgroups comp.lang.python
Date 2016-01-12 09:22 -0800
References <ab47c98f-69af-49ee-b1c4-bced0c48a001@googlegroups.com> <mailman.72.1452618660.13488.python-list@python.org>
Message-ID <f20e3ce6-3426-41dd-926e-3c0c745b3006@googlegroups.com> (permalink)
Subject Re: use Python and an outlook: protocol URL to bring up a specific email
From jkn <jkn_gg@nicorp.f9.co.uk>

Show all headers | View raw


Hi Chris

On Tuesday, January 12, 2016 at 5:11:18 PM UTC, Chris Angelico wrote:
> On Wed, Jan 13, 2016 at 3:51 AM, jkn <jkn_gg@nicorp.f9.co.uk> 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.
> 
> ChrisA

I'll try that, but (typically!) I found some things that worked shortly after
posting... 

These both work:

PROTOCOL = "outlook:"
TEST_URL = "00000000BB1BBDFACA3A... 84000026F87CCA0000" # elided for example

import os
os.startfile(PROTOCOL + TEST_URL, 'open')   # second parameter not needed

# and
import win32api
win32api.ShellExecute(0, 'open', PROTOCOL + TEST_URL, "", "", 0)


I thought I had already tried the first one, not sure what happened.

Sorry for the noise...

    Cheers
    Jon N


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

use Python and an outlook: protocol URL to bring up a specific email jkn <jkn_gg@nicorp.f9.co.uk> - 2016-01-12 08:51 -0800
  Re: use Python and an outlook: protocol URL to bring up a specific email Chris Angelico <rosuav@gmail.com> - 2016-01-13 04:10 +1100
    Re: use Python and an outlook: protocol URL to bring up a specific email jkn <jkn_gg@nicorp.f9.co.uk> - 2016-01-12 09:22 -0800
  Re: use Python and an outlook: protocol URL to bring up a specific email eryk sun <eryksun@gmail.com> - 2016-01-12 11:37 -0600
  Re: use Python and an outlook: protocol URL to bring up a specific email Chris Angelico <rosuav@gmail.com> - 2016-01-13 04:52 +1100
    Re: use Python and an outlook: protocol URL to bring up a specific email Christian Gollwitzer <auriocus@gmx.de> - 2016-01-12 19:04 +0100
  Re: use Python and an outlook: protocol URL to bring up a specific email eryk sun <eryksun@gmail.com> - 2016-01-12 13:12 -0600

csiph-web