【发布时间】:2009-08-30 05:50:51
【问题描述】:
我有一个 python 程序,可以在新浏览器窗口的单独选项卡中打开几个 url,但是当我从命令行运行程序并使用
打开浏览器时webbrowser.open_new(url)
来自 firefox 的 stderr 打印到 bash。查看文档,我似乎找不到重定向或抑制它们的方法
我已经使用了
browserInstance = subprocess.Popen(['firefox'], stdout=log, stderr=log)
其中 log 是一个临时文件,然后使用 webbrowser.open_new 打开其他选项卡。
有没有办法在 webbrowser 模块中做到这一点?
【问题讨论】: