What’s This Module For? Reading and writing files formatted using “YAML Ain’t Markup Language”” (YAML), and converting YAML syntax into native Python objects and datatypes. What is YAML? According to the website which houses the YAML Specification: YAML™ (rhymes with “camel”) is a human-friendly, cross language, Unicode based data serialization language designed around the common…
Category: Scripting
Tornado’s Big Feature is Not ‘Async’
I’ve been working with the Tornado web server pretty much since its release by the Facebook people several months ago. If you’ve never heard of it, it’s a sort of hybrid Python web framework and web server. On the framework side of the equation, Tornado has almost nothing. It’s completely bare bones when compared to…
Programmers that… can’t program.
So, I happened across this post about hiring programmers, which references two other posts about hiring programmers. There seems to be a demand for blog posts about hiring programmers, but that’s not why I’m writing this. I’m writing because there was this sort of nagging irony that I couldn’t help but stumble upon. In a…
Seeking Elegant Pythonic Solution
So, I have some code that queries a data source, and that data source sends me back an XML message. I have to parse the XML message so I can store information from it into a relational database. So, let’s say my XML response looks like this: <xml> <response> <results=2> <result> <fname>Brian</fname> <lname>Jones</lname> <gender>M</gender> <office_phone_ext>777</office_phone_ext>…
What “Batteries Included” Means
When I first got into Python, I read lots of blog posts that mentioned that Python was “the batteries included language”, but those same posts were short on any explanation of what that really meant. A few years and lots of projects later, I think I’m now qualified to at least give a beginner a…
Intro to Python 101 For Beginners
If you code Python already, go somewhere else. I’m only talking to complete and total newbies to the language right now. I want to show them the stuff that I wished someone had put in one nice, neat blog post for easy consumption when I got started with the language. If that’s what you’re looking…
If You Don’t Date Your Work, It Sucks.
I probably get more upset than is reasonable when I come across articles with no date on them. I scroll furiously for a few minutes, try to see if the date was put in some stupid place like the fine print written in almost-white-on-white at the bottom of the post surrounded by ads. Then I…
Head first into javascript (and jQuery)
So, I had to take a break from doing the Code Katas just as I was getting to the really cool one about Bloom Filters. The reason for the unexpected break from kata-ing was that I had a project thrown into my lap. I say “project” not because it was some huge thing that needed…
CodeKata 4: Data Munging
I’m continuing to take on the items in Dave Thomas’s Code Kata collection. It’s a nice way to spend a Sunday night, and it’s a good way to get my brain going again before work on Monday morning. It’s also fun and educational 🙂 CodeKata 4 is called “Data Munging”. It’s not very difficult data…
PyYaml with Aliases and Anchors
I didn’t know this little tidbit until yesterday and want to get it posted so I can refer to it later. I have this YAML config file that’s kinda long and has a lot of duplication in it. This isn’t what I’m working on, but let’s just say that you have a bunch of backup…