Let’s say I have two versions of Firefox installed. What is the way to get the default version of firefox printed? I am running the script in python. Is there way to get the output into python?
Assuming that the "default version" is whatever is executed when you enter firefox
in a terminal:
version=subprocess.check_output(['firefox','--version'])
-
This could be improved by indicating that python will run
firefox
with (some) $PATH, which dictates which Firefox will start. – Jeff Schaller♦ Nov 27 '17 at 12:08