当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Is it possible to get the default options for a Tkinter widget without instantiating its class?

问题描述:

This prints the default option configuration for the Text widget. Would it be possible to get this information without instantiating the Text widget class?

import Tkinter as tk

import pprint

root = tk.Tk()

text = tk.Text(root)

text.pack()

pprint.pprint(text.configure())

root.destroy()

root.mainloop()

网友答案:

No, it is not possible. It's quite acceptable to instantiate the class then destroy the widget once you have the information you need.

分享给朋友:
您可能感兴趣的文章:
随机阅读: