• Home
  • About
    • About The Coder
    • Language List
  • Code Rules
    • #1: Clarity Trumps Everything
    • #2: Source Code is for Humans
    • #3: Don’t Ignore Warnings
    • #4: Comment As You Go
    • #5: Always Use Parentheses
    • #6: Always Define Literals
    • #7: Never Repeat Yourself
  • CS-101
  • Python-101
  • Simple Tricks
  • Guestbook

The Hard-Core Coder

~ I can't stop writing code!

The Hard-Core Coder

Author Archives: Wyrd Smythe

Python Tk Calculator App

15 Monday Dec 2025

Posted by Wyrd Smythe in Python

≈ 1 Comment

Tags

Python code, software design

The previous post laid out the basics for creating windowing (GUI) apps in Python using the tkinter (Tk Interface) module. The module has been part of the standard library since Python versions 2.7 and 3.1.

In this post, as a small seasonal gift, I’ll start presenting a working GUI application — a script-driven pre-fix calculator with variables. Between the calculator code and its window code, there is too much for one post, so there will be (at least) a second part next week.

Continue reading →

Tk Windows in Python

24 Monday Nov 2025

Posted by Wyrd Smythe in Fun, Interesting, Python

≈ 2 Comments

Tags

Python code, software design

Python has included the Tk interface module (tkinter) since versions 2.7 and 3.1. The module is a binding to version 8.5 of the Tk GUI suite for making windowing applications. My first installed version of Python was 2.7, so I’ve been aware of the module for over ten years but never explored it.

At the beginning of this month, I decided to dive in. It led to an intense two-week bout of 12+ hour days, but I emerged with working apps (and my sanity). This post and ones to come document and share what I’ve learned.

Continue reading →

Dual Numbers in Python

17 Monday Nov 2025

Posted by Wyrd Smythe in Interesting, Python

≈ 1 Comment

Tags

dual number, function derivative, Python classes, Python code, software design

The last two weeks I’ve been on a serious coding binge teaching myself Python’s Tk module. Once I wrap things up, I plan to publish a series of tutorial posts.

In the meantime, here’s a trick I learned recently that allows one to start with a series of data point and use those to (quickly!) generate a set of corresponding data points that are the derivative of the function implied in the first set. The trick uses something called the dual numbers.

Continue reading →

Python Decorators, more

20 Monday Oct 2025

Posted by Wyrd Smythe in Python

≈ 2 Comments

Tags

Python 101, Python code, Python decorator, Python descriptors

Last time I explored a number of useful Python decorators. The post was a revisit to a topic I first posted about five years ago [see Python Decorators, part 1 and Python Decorators, part 2]. Back then I didn’t really know what to do with decorators, but I could see they were useful.

Since then, I’ve found many applications for them, hence the revisit to the topic. In this post, we’ll continue looking at useful applications. If nothing else, they may provide some ideas for decorators of your own.

Continue reading →

Python Decorators, redux

13 Monday Oct 2025

Posted by Wyrd Smythe in Python

≈ 2 Comments

Tags

Python 101, Python code, Python decorator

I wrote about Python decorators five years ago. [See Python Decorators, part 1 and Python Decorators, part 2] At the time, they were new to me, and I hadn’t thought of good use cases for them. Or really, even just good ways to use them.

But that changed during the last five years as I’ve had occasions to actually use decorators in code. They are extremely handy in certain situations. Today’s post takes a more useful look at Python decorators.

Continue reading →

Byte Multiplication Trick

29 Monday Sep 2025

Posted by Wyrd Smythe in Interesting, Python

≈ 1 Comment

Tags

GPU, Mandelbrot, Python code, software design

I’ve been working on an arbitrary-precision numeric class (in Python) that stores numbers in what amounts to base-256 — that is to say, in machine-native binary. It differs from the variable-length integers in Python by supporting fractions (and from Python’s Decimal number type by being binary).

It occurred to me I could implement multiplication with a lookup table rather than actually doing the math (at the CPU level, that may be what in fact is going on). So, I thought I’d compare the two implementations.

Continue reading →

Parsing Multipart Form Data

15 Monday Sep 2025

Posted by Wyrd Smythe in Interesting, Python

≈ 1 Comment

Tags

Python code, software development

I have a suite of simple CGI webapps that run on my localhost Apache webserver. Long ago they were Perl scripts. These days they are Python scripts. However, in some areas, Python can be a moving target. Case in point, the cgi module and the FieldStorage dictionary object.

The module was deprecated since Python 3.11 and removed in Python 3.13. Which I just installed on my new laptop. Which broke all my webapps. Which forced me to update them. Which went fine except for one app using multipart form data. This post documents the changes and some new code I wrote.

Continue reading →

Simple Python Tricks #18

25 Monday Aug 2025

Posted by Wyrd Smythe in Fun, Python

≈ 2 Comments

Tags

Simple Tricks, text

Recently I found myself dividing my attention between watching the Minnesota Twins lose yet another ballgame and goofing around with an idea that popped into my head for no reason I can name.

The idea turned out better than imagined in terms of capability given its design simplicity, so I thought I’d document it here. It’s not super useful as is, but those relatively new to Python might find it educational or otherwise helpful.

Continue reading →

Simple Python Tricks #17

18 Monday Aug 2025

Posted by Wyrd Smythe in Python

≈ 3 Comments

Tags

Python code, Simple Tricks, ZIP files

This edition of Simple Tricks contains a random collection of bits and pieces. First, some cute bits from the interweb, then some more-or-less one-off bits I whipped up for a project and which were just barely useful enough to keep. (If for no other reason than to publish them here.)

I’ll end with a pair of simple Python functions, one to list the contents of an existing ZIP file, and one to create a new one from files in a subdirectory. The latter can be the basis for a more sophisticated archive function.

Continue reading →

Simple Python Tricks #16

21 Monday Jul 2025

Posted by Wyrd Smythe in Python

≈ 1 Comment

Tags

Python classes, Python code, Simple Tricks

Simple Tricks #10 was about Python classes with a focus on the __new__ and __init__ built-in methods plus how to use them when extending Python’s built-in list, tuple, and dict classes.

In this edition of Simple Tricks, we’ll look at a number of possibly actually useful subclasses of Python’s dict class. Specifically, a “ticket” class, a “list of files” class, and an INI file class.

Continue reading →

← Older posts
Follow The Hard-Core Coder on WordPress.com

The Posts

  • Python Tk Calculator App
  • Tk Windows in Python
  • Dual Numbers in Python
  • Python Decorators, more
  • Python Decorators, redux
  • Byte Multiplication Trick
  • Parsing Multipart Form Data
  • Simple Python Tricks #18
  • Simple Python Tricks #17
  • Simple Python Tricks #16

The Topics

  • Blog (4)
  • CS101 (37)
  • Fun (36)
  • Interesting (5)
  • Opinion (12)
  • Python (59)
  • Stories (15)

The Month

December 2025
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Nov    

The Past

Posts

RSS Feed

Comments

RSS Feed

The Main Blog

Visit Logos con carne

Lots of wyrds... with meat!

The Author

Wyrd Smythe

Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts.

View Full Profile →

Create a website or blog at WordPress.com

  • Subscribe Subscribed
    • The Hard-Core Coder
    • Already have a WordPress.com account? Log in now.
    • The Hard-Core Coder
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar