Reputation: 3984
I need to associate to a hyperlink the command to execute firefox. Seeing as I can do it in a terminal, I used
os.system("/Applications/Firefox.app/Contents/MacOS/firefox"+' \"'+arg+'\" & 2> /dev/null')
but this doesnt work at all: I get a "Firefox is already running" window - while under Linux my url gets loaded in a new tab.
I tried the -remote switch, without effect
Any suggestions?
Upvotes: 2
Views: 2361
Reputation: 2379
To be more specific, to choose Firefox, if it is not the standard browser on the OS:
>>> import webbrowser
>>> controller = webbrowser.get('Firefox')
>>> controller.open('http://www.google.com')
True
Upvotes: 4