lellep
0
Q:

import tkinter

# for pip and windows, in cmd, write:
pip install tk
3
from tkinter import *
1
import tkinter as tk

obj = tk.Tk() # Creates a tkinter object
label = tk.Label(obj, text="This is a text button")
4
#How to import tkinter module in python
#-------------------------------------------------------------------------------
#Importing the tkinter module
from tkinter import *
#This tells python that a module is being imported in python ; normally importing is like import ___, but in this case, tkinter needs to be imported as "from tkinter import *"
#-------------------------------------------------------------------------------
-1
from tkinter import *
root = Tk()
root.mainloop()
#Tkinter is the GUI module for Python.
3

New to Communities?

Join the community