[Tutor] How to use custom protocol with requests?

Juan Christian juan0christian at gmail.com
Sun Oct 12 04:55:44 CEST 2014


On Sat, Oct 11, 2014 at 11:53 PM, Danny Yoo <dyoo at hashcollision.org> wrote:

> >> I need to call this URL: steam://friends/add/<ID>
> >>
> >> If I put it in my browser and press enter it works as expected, now I
> need
> >> to do this on my code, I don't need to retrieve anything, I just need
> it to
> >> be "executed", is there a way to do that in Python with requests or any
> >> other lib?
>
> Thinking about this a bit more. If your browser is already doing the
> "right thing", maybe the webbrowser module is enough to get this
> behavior:
>
>     https://docs.python.org/2/library/webbrowser.html
>
> webbrowser should invoke the browser on your behalf.  Maybe your web
> browser is set up to dispatch this to the steam application?  Hard to
> tell without testing this myself, but I'm not in an environment that
> lets me try this out at the moment.
>

YES, the browser redirects it to the Steam software installed on the PC!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141011/321d5aad/attachment-0001.html>


More information about the Tutor mailing list