
7 steps to install Tkinter and run a ‘Hello World’ file
- Download Visual Studio Code
- Create a new file for example main.py
- Check python version type python –version in the terminal
- Check the version of pip and execute the command
pip -V - Create a new virtual environment execute the command python -m venv /path/to/new/virtual/environment
- Install Tkinter pip install tk
- Import Tkinter and run a “Hello World” file
# Python tkinter hello world program
fromtkinter import*
root =Tk()
a =Label(root, text ="Hello World")
a.pack()
root.mainloop()
Then run the file, below is the result of your tkinter hello world program.



