Friday, June 26, 2009

Getting started with Python

Reader, this blog was started on June 26, 2009. Hopefully becomes a place to gather Python knowledge. To hone Python skills. And to share, anything Python.

I'm not a programmer by trade, but I do like writing code. Writing code, like writing a book or writing an article, satisfies the minds need for exercise. Solving a problem and getting to that "aha!" moment. That "eureka!" moment. I've read a dozen books on programming. My favourite book was "The C Programming Language" by Brian Kernighan and Dennis Ritchie. I remember well the phrase they used regarding the presentation style of the book; "C is not a big language, and it is not well served by a big book." In under three hundred pages they were able to completely describe all the features of one of the most popular system programming languages.

My hope is to try and capture a little of that C Programming Language style. Short and concise, yet complete enough with enough examples. A book that I think comes close to Kernighan and Ritchie's text but for Python is "Think Python: How to think like a Computer Scientist" by Allen B. Downey. Well written and absolutely easy to follow.

There are pros and cons when you read programming books. In many cases they describe the programming language but don't show you how to organise your thoughts and how to use it. In some cases, you won't get to the real meat until a few hundred pages later. A lot of time is spent on just describing the elements, or features, of the language and showing you trivial snippets of code. However, learning by doing is the best way to become proficient. It is said that if you want to gauge your knowledge about a subject, try to teach it to someone else. Well, here's my chance.

Like I said, I'm treating this as a conversation.



I'm sure the structure of this blog will change. There may be topics out of alignment since it's not supposed to be logically structured tutorial. Rather it is a knowledge base. My other hope is that it collects information about how things, real work, gets done in Python.

If you haven't written any computer programs you should be OK as long as you know how to use a text editor and have your Python environment set up. My operating system is Linux, but Python exists everywhere. On Linux, Windows and Macs. Hopefully all the code here is portable, but then again, who knows.



Here's the basic outline.

  • An explanation of Python data types. Get these out of the way.

  • Basic operations and program flow/control

  • Lists, tuples and dictionaries.

  • Functions

  • Strings (because we love them)




No comments:

Post a Comment