在哪里可以找到 tkinter 的 API 文档? [英] Where can I find API documentation for tkinter?
问题描述
我正在寻找 Python 的 tkinter
模块的完整在线参考.我试图自己找到一个,但由于某种原因我找不到.
I am looking for a complete online reference for Python's tkinter
module.
I've tried to find one by myself, but for some reason I can't.
澄清一下,我不是在寻找教程.相反,我想参考所有可用的类和属性.
To clarify, I am not looking for a tutorial. Instead, I would like to have a reference for all the available classes and attributes.
例如,如果我写这段代码:
For example, if I write this code:
from tkinter import *
root = Tk()
root.title("My title")
我想知道:Tk
类接受哪些可选参数进行实例化?Tk
对象的属性和方法是什么?title
接受哪些参数?等等……
I wonder: what optional arguments does the Tk
class accept for instantiation? What are properties and methods for a Tk
object? What arguments does title
accept? And so on...
看源"显然不是这个问题的答案.
"Look at the source" is not an answer to this question, obviously.
推荐答案
有关每个小部件支持的所有选项的权威指南,您应该查阅 tcl/tk 文档.将 tcl 翻译成 python 是一个相当微不足道的心理练习.唯一真正的问题是当 tcl 选项与 python 保留字冲突时(例如包和网格的 -in
选项)
For a definitive guide to all of the options supported by each widget you should consult the tcl/tk documentation. It's a fairly trivial mental exercise to translate the tcl into python. The only real problems are when the tcl options conflict with python reserved words (such as the -in
option for pack and grid)
这篇关于在哪里可以找到 tkinter 的 API 文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!