Reputation: 81
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()
Upvotes: 5
Views: 12684
Reputation: 15847
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.
Upvotes: 0
Reputation: 311
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.
Upvotes: 2