Python Forum

Full Version: tkinter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I installt python-tk and it works with python2 but not with python3.
Note: spelling in python 2 it's Tkinter (capitalized)
in python 3 it's tkinter (not capitalized)
But python gave me this output:
Traceback (most recent call last):
File "/home/linuxgamer21/Schreibtisch/animationentest.py", line 2, in <module>
import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'
with this code:
#!/usr/bin/python3
import tkinter as tk
 
root = tk.Tk()
  
thelabel = tk.Label(root, text="this is too easy")
thelabel.pack()
root.mainloop()
In Ubuntu, you need to install python3-tk
it works thankyou!
Pages: 1 2