简体   繁体   中英

ImportError: No module named tktable

I'm trying to import tktable to create a simple table, but I'm getting the error below:

File "prob.py", line 7, in import tktable ImportError: No module named tktable

from tkinter import *
import tktable

root = Tk()
root.title("Probabilidade e estatistica")

table = tktable.Table(root, rows=2, cols=10)
table.pack()

root.mainloop()

tktable isn't part of the standard tkinter package, meaning it's not a built-in feature.

You can download the tktable package from the Sourceforge website.

tktable does not come with the Python standard distributions, unfortuntely. Thus, you need to download and copy it to your working directory or put it under the site-packages folder of your Python distribution.

tktable is a wrapper library around the homonymous library for the Tcl language and its Tk GUI toolkit. It was written by Guilherme Polo (the guy who wrote ttk ). It supports images, embedded windows, varying colors and fonts, and more.

You can download a version of tktable which supports both Python 3 and Python 2 from this GitHub repository , where you can find other information on how to use it. A version for Python 2 is also available here . If you need a complete reference of all supported options, the ActiveState documentation on the Tcl/Tk TkTable might be the best way to go for now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM