Oreilly School of Technology

Screenshot-05252015-12:58:47PM

So this is my development environment!  Long live Vi!  Anyway, I’ve been taking the Python courses for the certificate in Python from Oreilly School of Technology.  It’s a good course, and I’m learning a lot.  I’m in the third of four courses, and we’re getting into some of the lesser talked about niches of Python.  In this lesson we’re using Properties and Decorators.  The assignment was to write an Address class that took ‘name’, ‘street_address’, ‘city’, ‘state’, and ‘zip_code’ as string arguments, which must then be set as attributes.  It was up to me to translate them into properties as needed to fulfill the assignment.  But after being set in __init__ the ‘name’ attribute must be read only.  Modifying must trigger an AttributeError.  Zip code must be a 5-digit string, and I had to create a ZipCodeError exception class that gets raised if the zip is not exactly 5 digits.  Likewise, the State had to be exactly 2 capital letters, and had to trigger a StateError exception, which are custom exceptions.  State and Zip validation had to be done by regular expressions, using the re module.  (That’s like my favorite module!)  And then they provided the unittest.TestCase that my module had to pass.  We’re big on test driven development (TDD) around here.  Write the test before you write the code!

I can see that Properties and Decorators can be pretty useful.  If I had been writing classes for years and years, and then found Properties and Decorators, that would be a BIG find!  But, I’ve been taking these classes since November, so I’m sure I’m not appreciating them as much as the guy had been looking for a way to encapsulate his class attributes dynamically for years and then invented Properties and Decorators!

My goal is to get good enough with Python to get a job using it.  And also to contribute to the Linux community somehow.  There are so many directions I could go, it’s hard for me to pick one at this point.  But I’m sure there are lots of projects I could help out with.

Meanwhile, I’ve been trying out some IDEs over on the Windows side, and I guess they’re okay.  But, I guess I just prefer the terminal window.  I usually have a bunch of them open.  They’re kind of like cashews; you can’t have just one.  Consequently, IDEs seem like a pretty thing I don’t know what to do with yet.  So it’s still Vim for me.

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s