Programming in Python 2024

Learn User Interface Programming Tools with Python GUI

Programming Basics & Databases4.8(56)10h 30m37 lectures3 sections

What you'll learn

  • Understand the introduction to graphical interfaces
  • Create and customize the main window
  • Divide the window using a Frame
  • Use Button, Label and Entry
  • Use Combo box, Check button and Radio button
  • Work with Dropdown Menus, Canvas and Table
  • Handle Events
  • Build a calculator program
  • Build a data entry program and a weather program

About this course

This course teaches Python GUI programming, building graphical user interfaces with Python and the Tkinter tool. You begin with an introduction to interfaces, then create the main window, display text on it, customize it and divide it with a Frame. Next you learn the core interface elements: Button, Label, Entry, Combo box, Check button, Radio button, Dropdown Menus, Canvas and Table, the difference between Classic and Themed widgets, plus variables and Events. Then you move to hands-on projects: a calculator, a time counter, a data entry program and a weather program built over several parts. Ready-made code is available to download at the end. The course suits anyone who knows the basics of Python and wants to make programs with a visual interface. You will need some basic Python experience before starting. Each lesson explains one element with a simple example so you understand it before moving on. By the end, you will be able to build simple desktop programs with buttons, menus and tables, and design them yourself.

Expected outcomes

  • Master creating graphical interfaces using Python.
  • Design interactive and user-friendly software applications.
  • Understand the basics of graphical elements like buttons, tables, and lists.
  • Create practical projects using Tkinter.

Learner reviews

These reviews are from learners who bought the content and completed at least 50% of it — there are no reviews from anyone who hasn't gone through the material.
4.8
★★★★★
56 reviews
5★
45
4★
10
3★
1
2★
0
1★
0

    Course content

    1

    Programming in Python 2024 (User Interface) Python GUI

    22 lectures
    1. Introduction to InterfacesAn introduction to building desktop application interfaces in Python with the Tkinter library, previewing examples such as a calculator, a timer, and a data entry form that saves to a file.7:24
    2. Create Main ScreenExplains creating the main window in Tkinter using the Tk class and a root object, and why the window disappears instantly unless the mainloop method is called to keep it open.10:53
    3. Display Text on ScreenExplains showing text on screen in Tkinter with the Label widget: creating the object, linking it to the root window, setting its text, and placing it with the pack method.10:13
    4. Customize Main Screen - Part OneExplains customizing the Tkinter main window: setting width and height with the geometry method, reading the screen size to center the window, and setting the window title.26:59
    5. Customize Main Screen - Part TwoExplains more Tkinter window properties: allowing or preventing resizing with the resizable method, setting a window icon, and defining minimum and maximum window sizes.10:12
    6. Split Screen Using FrameExplains dividing a Tkinter window with Frame widgets, setting their width, height and background color, comparing the place and pack methods, with an exercise drawing the Egyptian flag using colored frames.12:38
    7. Button BasicsExplains the basics of the Tkinter Button widget: creating it inside a specific Frame instead of the root window, positioning it with place, and changing the mouse cursor over it.13:21
    8. Label BasicsExplains the basics of the Tkinter Label widget for showing text under buttons, setting text and background colors, adjusting spacing with padding, and arranging widgets inside frames.10:58
    9. Entry BasicsExplains the Tkinter Entry widget for user input: creating it, attaching it to the window or frame, arranging it with a Label, and setting text alignment, color and background.6:49
    10. Difference Between Classic Widget and Themed WidgetExplains the difference between Classic Widgets and Themed Widgets in Tkinter: the available options differ, and themed widgets adapt their look to the platform the program runs on.10:44
    11. Set Properties for Themed WidgetExplains three ways to set options on Tkinter Themed Widgets: constructor arguments, dictionary-style indexing, and the config method.9:38
    12. Combo Box BasicsExplains the Tkinter Combobox for choosing a value from a dropdown list: setting the values option with a list or tuple, and making it read-only through the state option.7:40
    13. Get Data and Change Some PropertiesExplains getting the data the user types into an Entry with the get method when a button is clicked, then updating a Label with it using config or configure.21:16
    14. Variables in TkinterExplains Tkinter variables such as StringVar to link an Entry and a Label so typed text appears immediately, and using get and set to read and change the value.14:15
    15. Check Button BasicsExplains the Tkinter Check Button, which allows choosing multiple values, and linking it to a variable such as IntVar or StringVar to read its checked and unchecked state with get and set.20:12
    16. Radio Button BasicsExplains the Tkinter Radio Button and how it differs from Check Button, since it allows only one choice, linking the buttons to one variable with a different value per button to read the selection.12:45
    17. First ExerciseA practical exercise using Radio Buttons for a question with one correct answer, linking the buttons to a StringVar and telling the user on button click whether the answer is correct or wrong.13:21
    18. EventsExplains Events in Tkinter such as mouse movement, clicks and the pointer entering a widget, binding them to a function that receives event information, and the difference between the enter event and the mouse motion event.21:38
    19. Basics of Dropdown MenusExplains dropdown menus in Tkinter: storing a Combobox selection in a variable and handling the selection-change event, then the Spinbox for stepping through values up and down, and how the two differ.20:15
    20. Basics of CanvasExplains the Tkinter Canvas widget for drawing: drawing a rectangle from start and end coordinates, an oval or circle with a chosen color, and adding text and a button inside the canvas.21:31
    21. Basics of TableExplains showing data in a table with the ttk Treeview widget: defining columns and their headings with heading, adding rows with insert, and making the table fill the window with fill and expand.20:20
    22. Handling Events in TableExplains handling Treeview table events: binding a row-selection event to a function, reading the selected row's data with selection and item, and handling multiple selected rows with a for loop.17:20
    2

    Practical Applications

    13 lectures
    1. CalculatorBuilds a simple calculator app with Tkinter, focusing on arranging buttons with the grid method by setting rows, columns and column span, then reading the input and showing the result.34:14
    2. Time CounterBuilds a countdown timer app with Tkinter where the user enters hours, minutes and seconds, which are converted to total seconds and displayed counting down inside a loop.27:36
    3. Data Entry Program - Part OneStarts a Tkinter data entry app that saves name, age, contact and job to a csv file, designing the interface with a Frame and Label and Entry widgets and setting their positions.46:27
    4. Data Entry Program - Part TwoCompletes the data entry app with Save and Clear functions: it first validates the inputs and shows messages for empty fields, then saves the data to a csv file using DictWriter.41:47
    5. Data Entry Program - Part ThreeFinishes the data entry app with an Open button that shows a second window over the first, reads the csv file into a list, and displays the data in a table.15:29
    6. Weather Program - Part OneStarts the weather app that relies on an API, building the window in an object-oriented way with an App class that inherits from Tk, then adding a Label linked to the window.10:24
    7. Weather Program - Part TwoExplains connecting to the OpenWeatherMap service to get weather data: creating an account, getting an API key, building the request link with latitude, longitude or city name, and reading the JSON response.12:27
    8. Weather Program - Part ThreePrepares the weather app in practice by installing external modules for requests, images and time zones, storing the API key in a variable, and organizing the project folder with images and icons.6:52
    9. Weather Program - Part FourContinues the weather app by organizing its files, setting the window icon and preventing resizing, and displaying images with the PIL library, resizing them inside the app.19:32
    10. Weather Program - Part FiveBuilds the city search interface of the weather app: showing a search button image with PIL, a text box for the city name using a StringVar, and Label widgets for temperature and images.19:56
    11. Weather Program - Part SixContinues the weather app interface by adding Labels for humidity, pressure, visibility, sunrise and sunset, adjusting fonts, colors and positions, plus Reset and Exit buttons.17:57
    12. Weather Program - Part SevenBuilds the weather app logic: a Clear function and an Exit function with a confirmation message, fetching data in a separate thread, reading the JSON returned by the service, and showing weather and image per city.44:00
    13. Weather Program - Last PartFinishes the weather app by extracting data from the JSON and displaying it: temperature positioned by number of digits, humidity, pressure, visibility, and converting sunrise and sunset times to readable dates.13:27
    3

    Attachments

    2 attachments
    1. Download Basic Section Codes
    2. Download Practical Application Codes

    Instructor

    Eng. Amr Abdel Fattah

    Eng. Amr Abdel Fattah

    Computer systems engineer specializing in mobile app and website development, with experience in creating popular platforms and web applications.
    49.1K views20 courses

    This course is part of the diploma

    Related courses