Skip to Main Content
Tkinter GUI Application Development Blueprints
book

Tkinter GUI Application Development Blueprints

by Bhaskar Chaudhary
November 2015
Beginner to intermediate content levelBeginner to intermediate
340 pages
7h 29m
English
Packt Publishing
Content preview from Tkinter GUI Application Development Blueprints

Building a Snake game

Let's now build a simple Snake game. As usual, we will be making use of the Canvas widget to provide the platform for our Snake program.

We will use canvas.create_line to draw our snake, and canvas.create_rectangle to draw the snake food.

The primary objective for this project is to learn how to use Queue as a synchronization technique in a multithreaded application.

Writing a multithreaded application poses the challenge of synchronization between different threads. When multiple threads try to access shared data simultaneously, the data is likely to get corrupted or modified in ways that were not intended in the program. This is called a race condition.

7.02_race_condition.py demonstrates a race condition. The program is as ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Python Application Development

Learning Python Application Development

Ninad Sathaye

Publisher Resources

ISBN: 9781785889738Supplemental Content