How do I find the program associated with a given file type using Python under Windows?
For example, given http I’d like python to determine the default browser. I can do this from a cmd prompt by running ‘ftype http’. Windows gives me the full path to the browser.
I’ve tried:
subprocess.call(['http://www.google.com'])
which results in: WindowsError: [Error 2] The system cannot find the file specified
subprocess.check_call(['cmd', 'ftype', 'http'])
which launches a cmd window, but doesn’t do anything else
You’re missing the ‘/c’ option that configures
cmdto run a command and then exit: