Member-only story

How to create a Tkinter game board using Replit

Crystal X
2 min readMar 26, 2022

--

Python is a very versatile language, which has many capabilities. I normally write mt programs in Google Colab, but this program has its limitations, namely being the fact that it does not support a Graphical User Interface, or a GUI. Therefore, I have had to write some of my programs in Replit, which does have graphics capabilities.

When using Replit, however, some changes need to be made to the code. For instance, Tkinter is listed as a programming language, so this needs to be identified when the program is created. Once the programming language is defined as Tkinter, it should be a relatively easy matter to create a game board using this module of Python.

To illustrate my point, the screenshot below is the code used to make a simple game board using Tkinter:-

  1. The library is imported.
  2. The variables are defined.
  3. A for loop is created to draw the lines on the x axis.
  4. A for loop is created to draw the lines on the y axis.
  5. The main part of the program is called.

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet