Lesson 1: GUI programming with Python with TKINTER

Sign up for free and purchase a subscription to access any paid downloads available (£50.00), including power points and task files.




Sign up - Free to download the powerpoint and associated files.

Python is an amazingly powerful language and there is simply so much that can be done with it. If you've completed our lessons on Python and Pygame, you'll see the vast potential that exists in programming games with Python. Sometimes however, it may be necessary for you to work with things like forms and buttons. There are several different GUI type programs that you can use, but the sample series below looks at the use of TKINTER! It does take quite a lot of effort to put a tiny button on the screen and get it working, but once you get the hang of it, you're good to go, and it makes the visual interface a lot more appealing to work with.

Let's delve straight in. Above is lesson 1 in the series:

Overview of PYTHON GUI Programming with TKINTER:

LESSON 1

In this first lesson you'll look at the following: (with solutions provided of course!)
Task 1: Creating 3 widgets: a label, text entry and a button (and ‘PACK’)
Task 2: Changing the text on the label and the button
Task 3: Producing output on button click
Task 4: Creating a username and password login GUI (making it look pretty)
Task 5: Changing the position of objects using ‘PLACE’
Task 6: Changing the position of objects using the ‘GRID’ method
*Some additional tips and tricks on layout (alternative methods and code)
Task 7: Final outcome: Getting a Login Screen (username and password) to work using selection

LESSON 2

Task 1: Creating Menus (more on layout, following from Part 1)
Task 2: Making the Menu functional (creating functions attached to Menu items)
Task 3: Using Dialog Boxes (useful for all sorts of things!)
Task 4: Creating Radio Buttons
Task 5: Creating Check Boxes and attaching them to a function
Task 6: Creating Spin Boxes and Sliders (Scales)
Task 7: Creating List boxes
Task 8: Create your own text editor (Develop the existing code)

LESSON 3

Working with Lists
Task 1: Creating a List box, text entry box, and buttons (Challenge – create additional buttons)
Task 2: Add text input (into text box) and add it to the List box (using a function)
Task 3: Add functionality to the ‘sort list’ button. (research task and solution)
Task 4: Adding functionality to the ‘delete from list’ button
Writing and Reading from files
Task 5: Writing text (from text entry user input) to file
Task 6: Writing text from a list box to file
Task 7: Reading from a file
Task 8: Challenge: Putting your knowledge together. See what you can do!

GUI with Tkinter - Series solution files and projects





Your one stop for all things Python. Do look around!


What's included?
Our highly popular lessons series - content added regularly! Don't forget to also check out the "Solve & Learn Online" section which includes hugely popular lessons, challenges, tutorials, presentations, step by step guides and more. If you can't quite find what you need, do check out our very useful and growing library of all possible python Code Snippets
Series 1: includes variables, sequence, selection, iteration, and functions, not to mention a load of interesting computing trivia and theory embedded in each ppt, along with learning objectives, quizzes, challenges, solution .py files, tasks and suggested hw, discussion topics and research
Series 2: covers everything from functions to, lists, list operations, list comprehension, tuples, sets, dictionaries, file handling, read and write from file, including working with CSV files, creating a facebook like application (teacherbook!), using file read and write/append techniques. All lessons include practical tasks, challenges and solution files can be found in 'code snippets' (on this site) or downloaded from the drive:
Series 3: introduces the concept of object orientated programming and the use of classes with Python. Learn how to create your own classes (and objects) from scratch, and understand OOP essentials. Download pygame and create games in pygame, step by step tutorials. Create a class based game in python and pygame. Understand some of the principles behind game design in programming including edge detection and collision detection. Explore and understand the algorithms and maths behind these important game design essentials. Collision detection in Python and Edge detection, boundary detection. A look at class diagrams and UML for design.
Game Design Series -highly recommended as described above and create a platform game in Pygame
GUI Python with Tkinter
Content regularly added
Subscribe for access to the drive