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