Simple Python 3 threaded timer in Gtk3.

A quick and dirty timer example. If you need to execute after a period of time use Thread.Timer(). This example uses simple thread and event to start and stop a clock in a Gtk 3 window counting up time in a label. #!/usr/bin/python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk,Pango,GObject import threading import datetime […]

Python 3 ThreadPoolExecutor in Gtk 3

So I wanted to collect all the theme icons on my Linux machine so I wrote a little app. It is really fast using the ThreadPoolExecutor from futures. I’ve used this at work but never in a Gtk app. Here’s the result from the straight Python 3 code without a GUI. That’s a lot of […]

Get Dynatrace json dumps from threaded Python 3.

Today was a boring day so I was doing anything to make it go faster. I ended up redoing some Python code. It didn’t need to be threaded but I was bored! It’s cold, windy, and dark here. Blah! Maybe someone will find this useful? #!/usr/bin/python3 from concurrent.futures import ThreadPoolExecutor import requests # https://pypi.org/project/requests/ import […]

Batch base64 encode PNGs in Python 3 for use in CSS.

I wrote a simple Python 3 script to base64 encode a series of PNG images for use in CSS, or whatever. If you’re learning Python try adding file output or even go a step further and generate the CSS lines. If you’re here I will assume you are wanting these for CSS but if not, […]