Last September I participated in a one day full day basic Introduction to Python for Women workshop sponsored by PyStarPhilly. It was good exposure, but it didn’t stick all that much.
Fortunately, they decided to hold the workshop again (details here), and this time made it even longer, starting on Friday night and all day on Saturday last weekend.
Friday night started with making sure the Python install on my machine I did last September was still OK, and that Notepad++ was up to date. And making friends again with my cmd window, which I also use to run the Perl scripts at work. Whee my cmd skills are rusty. But between work and this workshop, it’s all surfacing from the deep recesses of my brain.
The rest of Friday can be summed up thusly: practice practice practice. The PyStar ladies have posted a series of exercises to practice the basics of Python on CodingBat. These exercises reinforce the concepts covered and force you to think through things.
Saturday morning began with completing Friday’s CodingBat exercises and working through some Saturday morning review exercises. Practice practice practice!
A few things I learned while working on the exercises:
- spaces don’t matter so much, although including spaces makes the code more readable
- punctuation matters!
- capitalization is noticed, so A =/= a, in other words, machines are very literal!
It is definitely sticking better this time. Between more coding stuff at work, plus Code Year, it’s all starting to come together in my brain. I got farther with the exercises this time, and was able to reason through (or talk myself through) when I got stuck.
After a bit of warmup practice, we had a morning lecture. The goal of the lecture was for us to be able to write simple scripts on our own by the end of it. We reviewed the material in the morning exercises (equations, functions, etc.) and covered loops, while loops, input statements, dictionaries, more detailed functions, modules and packages. Also a brief description of libraries.
And then it was back to practice practice practice.
Another challenge I discovered: indentations. Where your indentations are impacts what your code returns, so you have to be careful what you embed under other things, versus what you want to do at the end. Often I wrote the code correctly, but indented it too far relating it to something it shouldn’t be related to, producing no result, not even an error message. At one point I nearly created a recursive loop by indenting too far. Oops.
After lunch we had a few lightning talks, where people shared various code they’re written for projects. It’s encouraging to see what people have built; even more so that I can read and understand the code they wrote! The talks involved editing images (adding text), predictive puzzle solving (the Tower of Hanoi puzzle), and a very cool project working with 7 to 13 year old girls and the Tropo simple API. We also looked at a very neat page of data visualization and graphical plotting options using Python at matplotlib.sourceforge.net.
The talks also include some more learn to code resources. I’ll be posting the new ones I learned about to the catcode wiki resources page.
After the lightening talks, they gave us a project to work on (in addition to the CodingBat exercises) involving using Twitter’s API to call recent tweets and trending topics. Challenging but so satisfying when you get it!