Author Archives: Steve Ferg

How to post source code on WordPress

This post is for folks who blog about Python (or any programming language for that matter) on WordPress. Updated 2011-11-09 to make it easier to copy-and-paste the [sourcecode] template. My topic today is How to post source code on WordPress. … Continue reading

Posted in Miscellaneous | 23 Comments

Python3 pickling

Recently I was converting some old Python2 code to Python3 and I ran across a problem pickling and unpickling. I guess I would say it wasn’t a major problem because I found the solution fairly quickly with a bit of … Continue reading

Posted in Moving to Python 3

Yet Another Lambda Tutorial

There are a lot of tutorials[1] for Python’s lambda out there. A very helpful one is Mike Driscoll’s discussion of lambda on the Mouse vs Python blog. Mike’s discussion is excellent: clear, straight-forward, with useful illustrative examples. It helped me … Continue reading

Posted in Python features | 17 Comments

Read-Ahead and Python Generators

One of the early classics of program design is Michael Jackson’s Principles of Program Design (1975), which introduced (what later came to be known as) JSP: Jackson Structured Programming. Back in the 1970’s, most business application programs did their work … Continue reading

Posted in Python & JSD | 7 Comments

In Java, what is the difference between an abstract class and an interface?

This post is about Java, and has nothing to do with Python.  I’ve posted it here so that it can be available to other folks who might find it useful. (And because I don’t have a Java blog!) In Java, what … Continue reading

Posted in Java and Python | 14 Comments

Newline conversion in Python 3

I use Python on both Windows and Unix.  Occasionally when running on Windows  I need to read in a file containing Windows newlines and write it out with Unix/Linux newlines.  And sometimes when running on Unix, I need to run … Continue reading

Posted in Moving to Python 3 | 7 Comments

Why import star is a bad idea

When I was learning Python, I of course read the usual warnings. They told me: You can do from something_or_other import * but don’t do it. Importing star (asterisk, everything) is a Python Worst Practice. Don’t “import star”! But I … Continue reading

Posted in Python features | 11 Comments