tkinter 有表格小部件吗? [英] Does tkinter have a table widget?
问题描述
我正在学习 Python,我想用它来创建一个简单的 GUI 应用程序,并且由于 Tkinter
已经内置(并且非常易于使用)我想使用它来构建我的应用程序.
I'm learning Python, and I would like to use it to create a simple GUI application, and since Tkinter
is already built-in (and very simple to use) I would like to use it to build my application.
我想制作一个应用程序,该应用程序将显示一个表格,其中包含我从我的数据库加载的一些数据.
I would like to make an app that will display a table that contains some data that I've loaded from my database.
我搜索了 table
,但找不到任何关于 Tkinter table
组件的示例和/或文档.
I've searched for table
but have not been able to find any examples and / or documentation regarding a Tkinter table
component.
Tkinter
有内置的 table
组件吗?如果没有,我可以/应该使用什么来代替?
Does Tkinter
have a built in table
component? If not, what could I / should I use instead?
推荐答案
Tkinter 没有内置表格小部件.您可以使用的最接近的是 tkinter 子包 ttk
.
Tkinter doesn't have a built-in table widget. The closest you can use is a Listbox
or a Treeview
of the tkinter's sub package ttk
.
但是,您可以使用 tktable,它是 Tcl/Tk<的包装器/code>
TkTable
小部件,由 Guilherme Polo.注意:要使用这个包装库,你首先需要安装原始 Tk 的 TkTable
库,否则你会得到一个导入错误".
However, you can use tktable, which is a wrapper around the Tcl/Tk
TkTable
widget, written by Guilherme Polo. Note: to use this wrapper library you need first to have installed the original Tk's TkTable
library, otherwise you will get an "import error".
这篇关于tkinter 有表格小部件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!