因为默认浏览器是chrome 并且 因为文件路径没有以 “file://” 开头,所以导致失败。 正确的做法:
outfile = "file:///var/folders/86/2zqykwwd1f71bdb0d1tg20p80000gn/T/tmp28_694.html" webbrowser.open_new_tab(outfile)
使用webbrowser打开本地文件失败原因
原文:http://my.oschina.net/cxz001/blog/354397