python webbrowser

ale*_*dro 5 python python-webbrowser

我一直在使用这个模块,因为它被称为:

webbrowser.open("http link...")
Run Code Online (Sandbox Code Playgroud)

但是,现在,我想选择一个不同的浏览器,并根据文档(http://docs.python.org/library/webbrowser.html#webbrowser.get)我写了这个

controller = webbrowser.get('firefox')
controller("http link...")
Run Code Online (Sandbox Code Playgroud)

......我得到一个错误,我无法摆脱:

Exception in Tkinter callback
Traceback (most recent call last):
....
TypeError: 'Mozilla' object is not callable
Run Code Online (Sandbox Code Playgroud)

关于它的任何想法???

小智 6

Controller对象是不可调用.做这个:

controller.open(url)
Run Code Online (Sandbox Code Playgroud)