Python GUI Toolkits

Using CSS to Style a Python TUI with Textual

Textual is a Python framework for creating Text Based user interfaces (TUIs). You can create graphical user interfaces in your terminal with Textual. If you haven’t heard of Textual before, check out An Intro to Textual – Creating Text User Interfaces with Python In this tutorial, you will learn how to create and style a […]

Using CSS to Style a Python TUI with Textual Read More »

Python GUI Frameworks (Video)

In this tutorial, I talk about some of Python’s most popular GUI frameworks. You will learn the basics of graphical user interfaces. Then you will learn how to create a simple image viewer using wxPython. Finally, you will see how to rewrite the image viewer using PySimpleGUI. Related Reading Creating an Image Viewer with PySimpleGUI

Python GUI Frameworks (Video) Read More »

PySimpleGUI: Drawing Text on Images with a Python GUI

The Pillow package lets you draw text on images using Python. This includes using TrueType and OpenType fonts. You have a lot of flexibility when adding this text to your images. If you’d like to know more, you should check out Drawing Text on Images with Pillow and Python. Note: The code and fonts used

PySimpleGUI: Drawing Text on Images with a Python GUI Read More »

Letting Users Change a wx.ComboBox’s Contents in wxPython

This week I came across someone who was wondering if there was a way to allow the user to edit the contents of a wx.ComboBox. By editing the contents, I mean change the names of the pre-existing choices that the ComboBox contains, not adding new items to the widget. While editing the contents of the

Letting Users Change a wx.ComboBox’s Contents in wxPython Read More »

eBook Review: Creating Apps in Kivy

Kivy is a neat package that allows Python developers to create user interfaces on mobile devices. You can also deploy the applications to desktops too. This is the second book I’ve seen put out on the subject. The first book, Kivy – Interactive Applications in Python by Roberto Ulloa came out last year from Packt

eBook Review: Creating Apps in Kivy Read More »

wxPython 2.9 and the Newer Pubsub API: A Simple Tutorial

NOTE: This article is for wxPython 2.9-3.0. If you are using wxPython 4, you should go to my newer article Several years ago, I wrote a tutorial about wxPython 2.8 and its built-in pubsub module which you can read here. Back then, a new API for pubsub was added in wxPython 2.8.11.0 that could be

wxPython 2.9 and the Newer Pubsub API: A Simple Tutorial Read More »

wxPython: How to Communicate with Your GUI via sockets

I sometimes run into situations where it would be nice to have one of my Python scripts communicate with another of my Python scripts. For example, I might want to send a message from a command-line script that runs in the background to my wxPython GUI that’s running on the same machine. I had heard

wxPython: How to Communicate with Your GUI via sockets Read More »

PySide: Creating a Currency Converter

I am currently reading through Mark Summerfield’s book on PyQt, Rapid GUI Programming with Python and Qt and thought it would be fun to take some of the example applications in it and convert them to PySide. So I’ll be creating a series of articles where I’ll show the original PyQt examples from the book

PySide: Creating a Currency Converter Read More »

wxPython: How to Get Children Widgets from a Sizer

The other day, I stumbled across a question on StackOverflow asking how to get the children widgets of a BoxSizer. In wxPython, you would expect to call the sizer’s GetChildren() method. However, this returns a list of SizerItems objects rather than a list of the actual widgets themselves. You can see the difference if you

wxPython: How to Get Children Widgets from a Sizer Read More »

wxPython: How to make “flashing text”

People keep on asking fun wxPython questions on StackOverflow. Today they wanted to know how to make “flashing text” in wxPython. That’s actually a pretty easy thing to do. Let’s take a look at some simple code: import random import time import wx ######################################################################## class MyPanel(wx.Panel): “””””” #———————————————————————- def __init__(self, parent): “””Constructor””” wx.Panel.__init__(self, parent) self.font

wxPython: How to make “flashing text” Read More »