It’s simple.
For python2 it is:
from Tkinter import *
For python3 it is:
from tkinter import *
Here’s the way how can you forget about this confusion once and for all:
try:
from Tkinter import *
except ImportError:
from tkinter import *
More Related Contents:
- Difference between import tkinter as tk and from tkinter import
- Tkinter understanding mainloop
- Why do my Tkinter widgets get stored as None? [duplicate]
- Install tkinter for Python
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- How to make a Tkinter window jump to the front?
- How to center a window on the screen in Tkinter?
- Correct way to implement a custom popup tkinter dialog box
- How do I bind the enter key to a function in tkinter?
- What could cause a python module to be imported twice?
- Tkinter grid_forget is clearing the frame
- Python Tkinter Embed Matplotlib in GUI
- Tkinter IntVar returning PY_VAR0 instead of value
- How to redirect stdout to a Tkinter Text widget
- from … import OR import … as for modules
- Creating a table look-a-like Tkinter
- How do I create an automatically updating GUI using Tkinter?
- Use asyncio and Tkinter (or another GUI lib) together without freezing the GUI
- Python, doing conditional imports the right way
- How to create a self resizing grid of buttons in tkinter?
- How do I remove the light grey border around my Canvas widget?
- python tkinter with threading causing crash
- Tkinter PIL image not displaying inside of a function
- Layering graphical interfaces on top of each other
- Colour chart for Tkinter and Tix
- How to set the min and max height or width of a Frame?
- Tkinter Grid: How to position widgets so they are not stuck together
- Execute a command on Remote Machine in Python
- How to get the Tkinter Label text?
- tkinter Canvas Scrollbar with Grid?