我正在寻找帮助,在pgu gui的名单上进行游戏。我需要知道它们有哪些方法和属性,所以我可以将它们包括在我的程序中。
发布于 2010-10-29 20:11:33
我的第一个建议
使用python对进行反思
import pgu.gui.List
import inspect
help(pgu.gui.List) # to read out the doc strings
print dir(pgu.gui.List) # to get the namespace of List class
# to get all methods of that class
all_functions = inspect.getmembers(pgu.gui.List, inspect.isfunction) 当源代码可用时,总是查看源代码。
代码中的:您可以创建和清除一个列表.
class List(ScrollArea):
"""A list of items in an area.
<p>This widget can be a form element, it has a value set to whatever item is selected.</p>
<pre>List(width,height)</pre>
"""
....
def clear(self):
"""Clear the list.
<pre>List.clear()</pre>
"""
...使用:
# Create the actual widget
usagelist = gui.List(width, height)https://stackoverflow.com/questions/4055347
复制相似问题