您在 tkinter 中将哪个小部件用于 Excel 之类的表格?

编程入门 行业动态 更新时间:2024-10-25 22:24:22
本文介绍了您在 tkinter 中将哪个小部件用于 Excel 之类的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想要一个类似于 tkinter 中的表格小部件的 Excel,用于我正在编写的 gui.您有什么建议吗?

I want a Excel like table widget in tkinter for a gui I am writing. Do you have any suggestions?

推荐答案

Tktable 至少是如果您需要全表支持,可以说是最好的选择.简而言之,以下示例展示了如何使用它(假设您已安装它).这个例子是针对python3的,但是对于python2你只需要修改import语句即可.

Tktable is at least arguably the best option, if you need full table support. Briefly, the following example shows how to use it assuming you have it installed. The example is for python3, but for python2 you only need to change the import statement.

import tkinter as tk
import tktable

root = tk.Tk()
table = tktable.Table(root, rows=10, cols=4)
table.pack(side="top", fill="both", expand=True)
root.mainloop()

Tktable 可能很难安装,因为没有 pip-installable 包.

Tktable can be difficult to install since there is no pip-installable package.

如果您真正需要的只是用于显示和编辑数据的小部件网格,您可以轻松构建条目或标签小部件的网格.例如,请参阅问题此答案的此答案/7432">蟒蛇.GUI(输入和输出矩阵)?

If all you really need is a grid of widgets for displaying and editing data, you can easily build a grid of entry or label widgets. For an example, see this answer to the question Python. GUI(input and output matrices)?

这篇关于您在 tkinter 中将哪个小部件用于 Excel 之类的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 08:24:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1391420.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您在   中将   部件   表格   tkinter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!