How do I invoke IE browser from Python on Mac OS X?

Skip Montanaro skip at pobox.com
Sun Oct 20 21:16:57 EDT 2002


    Paul> How do I invoke Internet Explorer (or other package) from Python
    Paul> (or from a shell prompt for that matter) on Mac OS X.  

Having just learned this recently myself, I figure passing it along would be
worthwhile... ;-) MacOSX has an open(1) command which it inherited from
NeXT.  To open the Python home page using the default web browser, execute:

    open http://www.python.org/

If IE isn't your default browser, you can give open(1) the -a argument
followed by the name of the executable, something like:

    open -a 'somethingorother' http://www.python.org/

Alas, I can't figure out what 'somethingorother' should be.  Based on the
example in the open(1) man page, I would have guessed this would work:

    open -a '/Applications/Internet Explorer.app' http://www.python.org/

but it doesn't work for me (the document continues to display in Opera, my
default browser).

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list