> import webbrowser
> webbrowser.open('f:\\test.html')
> why the file f:\\test.html is opened by notepad
> ,not by my firefox or chrome?
The default protocol in a browser is http. If you're not running a server on
your local machine, you need to specify a different protocol. Try
file:///f:/test.html
I also don't run Windows any more so I might have the drive letter part wrong.
--
DaveA
Original message
From: luofeiyu
Date:09/24/2014 5:32 AM (GMT-05:00)
To: python-list@python.org
Subject: why can't open the file with browser?
import webbrowser
webbrowser.open('f:\\test.html')
why the file f:\\test.html is opened by notepad ,not by my firefox or chrome?
--
https://mail.python.org/mailman/listinfo/python-list