There is a lot going on

The title is generally true, but in this case, I’m talking about an interesting article about the steps that happen when you run python3 hello.py. It’s a really nice breakdown of all the steps from figuring out the path to the python executable to mapping that file on the disk to creating a new process to finding the ELF file to linking to libraries to printing out “Hello World!”. The detail is nice.

Read More

Awk lives

Awk is pretty ancient (1977) but is a nice tool to know for text processing. I’m no expert, but I do use Awk from time to time for various simple tasks. A second edition of The AWK Programming Language is coming out in October and it looks interesting based on what I read through on O’Reilly. This article shares some of the highlights including a chapter on data analysis and an updated simple version of Make in Awk.

Read More

PyCell

Python in Excel looks interesting. It’s only in public preview now and will go Windows first so I won’t see it for a while. Python has some really awesome tools for analytics and plots. Although it probably won’t ever be a mainstream tool, many data analysts are going to be all over this. I’ll definitely take a look when it’s out there. I played around with openpyxl a few times and it has some usefulness but is not as tightly integrated as the new =py() function.

Read More

Supply Chain Problems

Since I just completed Developing Secure Software and got my certificate, I’ve been paying more attention to the security aspects of the process of developing software. This article about npm and PyPi security caught my eye. The article describes a paper that evaluates the security practices for these widely used software repositories and finds them lacking. They do follow many of the best practices but fall short on some others. The number of packages that were found to have vulnerable patterns is less than 1%, but that doesn’t help you if you use one and get attacked.

Read More

Out With The Old

This article makes some very good points about moving on from old constructs in Python. I’m guilty of using some of the older methods including os for file manipulation instead of pathlib. Mostly this is because it’s how I learned to do it but it’s time to stop now. I’m using pathlib from now on. I’m a little better about some of the other points mentioned. I’ve used dataclasses in a few different things and they work well.

Read More

Blessed be

I was experimenting with the NHL API the other day. It was interesting and I didn’t want to make things really complicated, but something that I did want was to be able to update the sceeen in place without it scrolling for each update. Curses is the obvious solution for this, but it seemed a little complicated for a simple little program. I did some digging and found Blessed which is a nice Python library that wraps up curses functionality in a much easier to use package.

Read More

NHL API fun

The NHL has an interesting API that can access a wide range of information. It isn’t officially documented but I found some decent informal documentation. For fun, I wrote a Python program to get the live feed for the games going on today. It’s nothing special but was an interesting diversion. The biggest challenge is working with the live feed when I want to watch the game. The code is below:

Read More

Homework helper

My son is a senior in high school this year and is taking AP Statistics. My daughter also took this course when she was in high school. Overall, it’s a good set of content and being able to understand and reason with statistics is a valuable life skill. An odd thing is that the teacher has assigned problem sets that require using Python. He doesn’t know Python and I don’t know how he would be able to complete the assignments without having someone at home who does.

Read More

Popular PyPi Packages

I’ll occassionaly take a look at the most popular PyPi packages to see what’s going on in the Python world in general. The top ten items are interesting: urllib3 has obvious appeal and widespread use due to the heavy use of Python in networked applications. Many other packages reference this as well. six isn’t something that I personally use, but there is a lot of Python 2 code out there and being able to bring it into Python 3 is a common use case.

Read More

Building a recommender engine - part 3

I finally got to the very last part of building a recommender engine. Starting from my post a couple of months ago on the topic, I created a very simple Flask app that serves the model created by the nearest-neighbors recommender. It’s not very exciting but at least shows how it can be done. As I mention in the README for the project, the results are not exactly what I was hoping for but I think that beer recommendations are more complicated than “if you like this, you will like that”.

Read More