3

Its very simple. I don't want to know how to connect to the default browser, because I already know that webbrowser will do that for me. But after I use that, I want to know which browser exactly webbrowser connected to for other parts of my program. Literally, isn't there some way to use python to ask "what is the default browser?" and get an answer of "iexplore" or "chrome" or "firefox"? Any help appreciated. Thanks!

EDIT: I've already tried using this code: from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValue # In Py3, this module is called winreg without the underscore

with OpenKey(HKEY_CURRENT_USER,
          r"Software\Classes\http\shell\open\command") as key:
    cmd = QueryValue(key, None)

But this doesn't actually return me the default browser. Even when I explicitly check Internet Explorer as my default browser, this code always returns that Google Chrome is the default browser.

Megan
  • 51
  • 1
  • 6

0 Answers0