Python3.1 - Open Opera
Question: I have no idea why this won't work....I'm trying to open opera but it says
cannot find runnable browser.

    
    
    op = webbrowser.get('C:\\Program Files\\Opera\\opera.exe')
    
    op.open_new_tab('http://www.stackoverflow.com')
    op.open_new_tab('http://www.stackoverflow.com')
    


Answer: The name parameter should just be 'opera':

    
    
    op = webbrowser.get('opera')
    

Make sure you have installed Opera on your computer, and that the executable
opera.exe is in the path.

    
    
    >>> import webbrowser
    >>> webbrowser.get('opera')
    <webbrowser.BackgroundBrowser object at 0x02095490>
    

See the [table of allowed values for the name
parameter](http://docs.python.org/library/webbrowser.html#webbrowser.get) in
the documentation.

If you want to specify the exact path to the executable (which by the way is a
bad idea if you want your application to be portable) then you can specify the
command line as follows:

    
    
    op = webbrowser.get(r'C:\\Program Files\\Opera\\opera.exe %s')
    

