• 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

Category Archives: Python

Exploring Python.

Python Decorators, part 1

24 Friday Apr 2020

Posted by Wyrd Smythe in Python

≈ 5 Comments

Tags

Aspect-Oriented Programming, Python 101, Python code, Python decorator

I’ve been playing around with what Python calls decorators. They’re a built-in way of implementing Aspect-Oriented Programming techniques in Python. In fact, they’re quite powerful.

Since they aren’t a common language feature, they can be a little confusing at first, so I thought I’d try my hand at laying out how they work.

Continue reading →

The Eight Queens

23 Sunday Jun 2019

Posted by Wyrd Smythe in CS101, Fun, Python

≈ 1 Comment

Tags

computer code, Python code

There’s a fairly simple puzzle, called The Eight Queens, that I’ve long favored as a project for first semester CS students. The problem is simple enough for a beginner to tackle, yet also interesting enough to be engaging. (And just tricky enough to be a nice beginner challenge.)

Due to a discussion on my other blog, I dug out an old Python implementation I had, and, after looking at it, I thought it might be worth writing a post about. If nothing else, as I said, the problem is interesting enough to be engaging.

Continue reading →

So Random!

01 Tuesday Jan 2019

Posted by Wyrd Smythe in Fun, Python

≈ 5 Comments

Tags

Python code, random

To ring in the new year, I thought I’d play around with an old friend from my earliest programming days, a random text generator. Back then (over 30 years ago), but a little bit always, a good way to practice programming is by working on small, relatively easy, but still fun, programs.

Simple games are common choice, but not the only one. (I’ve probably written a version of Mastermind in every programming language I know.) Another fun choice is various image or text generators (or processors). Random text generators, in particular, offer a range of complexity depending on your taste and time.

Continue reading →

Knowing Where To Bang

02 Wednesday Aug 2017

Posted by Wyrd Smythe in Python, Stories

≈ Leave a comment

Tags

computer programmers, computer programming, debugging, old joke, Python code, tips

Sometimes ya gotta laugh. I just spent nearly an hour chasing one of those bugs that “can’t be happening” because “the code looks absolutely correct (as far as I can tell).” Of course, the bug, once you find it, was always hiding in plain view.

This time the fix involved adding just two characters and incidentally improving the program semantics, and very much reminded me of the old joke about the huge cargo ship that breaks down at sea…

Continue reading →

Aside

Update July 2017

20 Thursday Jul 2017

Posted by Wyrd Smythe in Blog, Python

≈ Leave a comment

Tags

computer languages, computer programmer, data, Matplotlib, NOAA, programming language, Pythonista, SQL, SQLite, xkcd

In the unlikely event anyone is reading this, and more in the original spirit of “web logs“, as much a diary entry to record both the passing of time and the moment, after a long period of quiet, and in the long-winded run-on way that I sometimes have, a post.

Continue reading →

Python Pi

14 Monday Mar 2016

Posted by Wyrd Smythe in Fun, Python

≈ 1 Comment

Tags

digits of pi, pi, Pi Day, Python code

For Pi Day I published a post on my main blog, Logos Con Carne. Here is the Python code behind the data generated in that post.

Continue reading →

Little Programming Languages

06 Tuesday Oct 2015

Posted by Wyrd Smythe in Python, Stories

≈ Leave a comment

Tags

computer language, language design, Lisp, little programming language, LPL, programming language, syntax

One characteristic of the hard-core coder is a love of computer languages, programming languages in particular. Programmers of that ilk — of my ilk — collect new languages like merit badges. (I get a kick out of saying that I’ve programmed “from Ada to the Z-80!”)

The especially far gone of us also enjoy creating new languages (or in some cases, new dialects of XML). Lately I’ve been playing with a language design that follows a favorite theme: the single-syntax construction language.

Continue reading →

Python & Baseball

19 Monday May 2014

Posted by Wyrd Smythe in Fun, Python

≈ 1 Comment

Tags

baseball, character graphics, computer programming, imperative programming language, Minnesota Twins, programming language, Python code, Target Field

One of the cool things about being a carpenter is that you can make your own shelves and dog houses. One of the cool things about being a computer programmer is that you can make your own computer apps!

In an era when computers are so much a part of life, that’s a useful skill. And the nice thing about doing it yourself is that things turn out exactly as you want them. You can make things that are perfect just for you.

Case in point: using Python to create custom charts of baseball stats!

Continue reading →

Too much specialization!

06 Thursday Mar 2014

Posted by Wyrd Smythe in Python, Stories

≈ Leave a comment

Tags

BOOL, code isolation, computer programming, encapsulation, software design, sub-class

To make this blog (I hope) useful, I have tips and advice and bits of advice. But the initial motivation was wanting to write about programming or software in general — topics too technical for my regular blog. In particular, I wanted a place to document past projects, ideas and personal (but sharable) thoughts about coding. I wanted a place to tell stories.

Today I have a story to tell about a programming project I’m working on.

Continue reading →

Newer 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