Reputation: 11028
>>> webbrowser.open("www.python.org")
False
Is there any other way to get the same functionality of that function in Cygwin?
Upvotes: 0
Views: 2751
Reputation: 34324
export BROWSER=cygstart
before starting Python. Then it should work.
Upvotes: 13
Reputation: 1417
Launching a web browser from Cygwin can be done through
cygstart "http://www.google.com"
where google.com is your desired URL.
cygstart launches the default windows program for a path, so this way you get the user’s preferred web browser.
So in Python under Cygwin you might just:
from subprocess import call
call(["cygstart", "http://www.google.com"])
or try another option from here to run the Python-external command.
If it's not just a one-off script you are writing for your own use, you should use platform.system
to use the above on Cygwin, and webbrowser.open
on other platforms.
Upvotes: 2