Learning Python

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!

Advertisements

About slmcdanold

I’m learning to laugh at myself on a daily basis. I’m a librarian (cataloger) and I love it. My job involves all things metadata related in any and all formats. I have been known to cause a ruckus when necessary (aka troublesome cataloger) and make no apologies for it. I have a passion for continuing education and teaching. I’m a newbie coder (still learning). I like to cook. I’m a fan of rugby (go Australian Wallabies!) and ice hockey (go Detroit Red Wings!). I’m car-free and bike/walk a lot. I’m learning to love running one stride at a time. I own (and love) a very mouthy cat with a punk attitude and a slightly neurotic rescue mutt.
This entry was posted in catcode, coding, Python. Bookmark the permalink.

3 Responses to Learning Python

  1. Andromeda says:

    Oh, hey! Are you using tweepy for the Python/Twitter interface? that's what I used for @jagaurbot. Don't know about that part of the API, though.

  2. It was something created specifically for the course that uses a Python twitterAPI code. We were writing things using it. 🙂

  3. Glen Roberts says:

    Keep it up! I'm currently learning Java and a friend of mine is learning Python. He speaks very highly of it and I've seen some of his work its amazing what he's been able to accomplish and by the sound of it you are on your way to doing great things also.I just stumbled here and read your post. Again good luck and practice!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s