Installing PyAudio on macOS

Installing pyaudio on macOS is almost straightforward, except that you need portaudio installed. The easiest way to remedy this is to use homebrew. If you have your homebrew installing in the recomended location it is as simple as the following: brew install portaudio pipenv install pyaudio However if you have…

Python CSV Module Oddity

A Python Oddity I was using Python to encode a CSV file using a custom dialect recently when I noticed something odd. I noticed that the csv writer class takes an optional argument that enables you to change the line terminator.  That's ok, however, the csv reader class does not…

Odd Behavior in Python 2.7

I was tinkering around with replacing the print statement with the print function in a Python 2 script when I ran across this peculiar oddity. >>> from __future__ import print_function as print File "<stdin>", line 1 from __future__ import print_function as print ^ SyntaxError: invalid syntax >>> from __future__ import…

You're Too Close

Have you encountered the following scenario? You are trying to solve a problem (or helping solve a problem) and know or at least think you know the solution.  You are in the middle of implementing it when someone else looks at it and says, "why don't you do it this…

Installing Technical Analysis Library for Python

I'm tinkering with some financial analysis scripts so when I got to looking into some useful python packages, Technical Anaysis Library popped up.  The python bindings require the TA Lib (Technical Analysis Library) which on osx is available via homebrew.  Now, when I originally installed I didn't want to install…

Thoughts on MVP

We all know that getting to a minimum viable product (MVP) is a race.  It is a race against competition, market need, industry direction, etc, etc etc.  I came to a realization recently that reaching MVP can also be a race against yourself and how long your technological choices hold…

The Python "in" Operator – Theoretical vs Actual Time Complexity

Background Sometimes we may generate or retrieve a list, set or even dict when creating collection of things that we will be testing against.  Theoretically a set, frozenset or dictionary should be the fastest (and equivalent) forms of storage for this operation.  However, what I've found is that on some…