【发布时间】:2015-09-09 09:49:50
【问题描述】:
我现在正在学习 Tkinter。要获得有关方法的更多信息,我阅读了 pydocs。
问题是我打电话的时候:
>>>help(Text.configure)
我明白了:
configure(self, cnf=None, **kw)
Configure resources of a widget.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method keys.
那么我将如何调用或列出所有方法键?
我试过了:
>>>Text.configure.keys()
和
>>>Text.configure().keys()
但它们当然不起作用,因为它是一个函数而不是字典。
【问题讨论】:
-
或许可以试试
Text().keys()? -
@ReutSharabani 那是
TypeError;它是一个实例方法,而不是一个类方法 -
@jonrsharpe 是的,我在猜,但我看到你已经回答了。
-
也刚刚意识到
>>>help(Text)也显示了它们,只是它们的名称不同。
标签: python python-3.x tkinter