Skip to content
  • YouTube
  • FaceBook
  • Twitter
  • Instagram

Data Analytics Ireland

Data Analytics and Video Tutorials

  • Home
  • Contact
  • About Us
    • Latest
    • Write for us
    • Learn more information about our website
  • Useful Links
  • Glossary
  • All Categories
  • Faq
  • Livestream
  • Toggle search form
  • planning your machine learning model machine learning
  • how do I merge two dictionaries in Python? Python
  • how to use case statements in SQL SQL
  • TypeError: ‘int’ object is not callable Python
  • how to update records in SQL CRUD
  • how to select all records with SQL SQL
  • R – How to open a file R Programming
  • Python Tutorial: How to create charts in Excel Python Tutorial

Tkinter python tutorial

Posted on June 1, 2020January 17, 2021 By admin No Comments on Tkinter python tutorial

Estimated reading time: 3 minutes

Let’s make the introductions 🙂
Tkinter is a package that allows a programmer to build a GUI interface, which then can be opened on a computer screen by a user. There are many different types of GUI apps, but examples include a calculator or a text editor that opens when you click it.

Tkinter would be the most commonly used GUI package in Python, due to its simplicity, but PySimpleGUI, PYQt or PySide are other alternatives. Ensure you research these before using to make sure they suitable for your needs.

Why use Tkinter?

  • Relatively simple and easy to learn, upskilling is quick.
  • A great introduction to the concepts and ideas for building GUI apps, you will get a good grounding in the techniques and approaches needed.
  • Very well documented, so a programmer should be able to find the answer to anything specific they need to understand.

Now we are introduced, let’s see how to utilise it:

Install Python as usual, and make sure that Tkinter is working and you have the correct version. Note that import tkinter is for version 3.x, before that use import Tkinter

Please note that you will see in places when using Python code, that capitalization is important. This will sometimes puzzle you as to why some of your code does not work, usually, the interpreter should flag it for you.

While it is correct to put a capital at the start of a line, the programming language will ignore written English convention. An example is as follows:

list = ['a','b','c']
Print(list)
gives 
NameError: name 'Print' is not defined
whereas
list = ['a','b','c']
print(list)
gives ['a', 'b', 'c'] 
No errors

When saving your python script DO NOT call it tkinter.py as I did, the import statement will not work. Call it something like tkinter_test.py, see red arrow below.

At the start of the video below the code will look like this. the first six lines are the creation of the Tkinter screen its size and any buttons that will appear on it.

Note that all code should appear betwee line two and line six, so that the screen output works and looks correctly.

Added to this code in the following video:

  • Button – which will open our YouTube channel
  • An image
  • A clickable link – Which will bring you to our Home Page

A screenshot of the final output is as follows:

See a link to the Python documentation here Tkinter on python.org

Python Tags:Data, Data Analysis, Data Analytics, Data Science, graphical user interface, gui, Python, python programming, python tkinter, Python Tutorial

Post navigation

Previous Post: Recursion
Next Post: how to remove unwanted characters from your data

Related Posts

  • How to Create Multiple XML Files From Excel With Python Python
  • Python tutorial: Pandas groupby ( Video 1) Python
  • How To Validate Cell Values In Excel Python
  • ValueError: Columns must be same length as key exception handling
  • How to use parameters in Python Python
  • How to Pass Python Variables to Javascript Javascript

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Select your language!

  • हिंदी
  • Español
  • Português
  • Français
  • Italiano
  • How to connect to your data in Tableau data visualisation
  • TypeError: ‘float’ object is not callable Python
  • How to Create Multiple XML Files From Excel With Python Python
  • How To Create An Empty Dictionary In Python python dictionaries
  • python sort method python method
  • Free ways to Extract Data from Files Livestream
  • how to update records in SQL CRUD
  • YouTube channel lists – Python DataFrames Python Dataframe

Copyright © 2023 Data Analytics Ireland.

Powered by PressBook Premium theme

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT