My first steps with Python
In the process of researching no starch, I happened across a title Automate the Boring Stuff with Python. This concept resonated deeply with me, as the primary motivator of my programming work to date has been aimed at automating manual (and sometimes boring) workflows.
I’ve crossed paths with python a number of times in the past, generally in the context of Linux. I seem to have absorbed some of the ‘just a scripting language’ bias in the past, but now I’m ready to take a fresh look.
Learn Python the Hard Way
So, here I am. I’ve surveyed the internet for resources providing instruction on getting started with python. I happened across Zed Shaw’s Learn Code the Hard Way series and have quickly dug into the python flavor.
I have been following the instructions to the letter and now have a working install of python, with Atom as my editor. As expected, it has been slow going as I start climbing the learning curve. I eventually worked my way up to this tidbit, which is example 5.
his_name = 'Zed A. Shaw' his_age = 35 # not a lie his_height = 74 # inches his_weight = 180 # lbs his_eyes = 'Blue' his_teeth = 'White' his_hair = 'Brown' print "Let's talk about %s." % his_name print "He's %d inches tall." % his_height print "He's %d pounds heavy." % his_weight print "Actually that's not too heavy." print "He's got %s eyes and %s hair." % (his_eyes, his_hair) print "His teeth are usually %s depending on the coffee." % his_teeth # this line is tricky. Try to get it exactly right print "If I add %d, %d, and %d I get %d." % ( his_age, his_height, his_weight, his_age + his_height + his_weight)
So, I’m officially on my way to learning python. Things are going slow, of course, but I feel like I’m quickly acclimating to the whitespace. I really like this course! It seems to be very straightforward, and I like the philosophy of putting in your time and not looking for shortcuts. Of course, months from now, I will look back and marvel at the simplicity of the code I wrote in these first few days with the language.