Reputation: 3621
The following program opens a browser and navigates to www.cnn.com on Windows, but in OS X nothing happens. I'm not sure why.
import webbrowser
webbrowser.open_new("www.cnn.com")
Any thoughts?
Upvotes: 3
Views: 1118
Reputation: 81926
You need to do:
import webbrowser
webbrowser.open_new("http://www.cnn.com")
On OS X, this is converted to the following shell command:
echo 'open location "http://www.cnn.com"' | osascript
For whatever reason, open location www.cnn.com
does not work in osascript on OS X.
This was tested on OS X Lion.
Upvotes: 7