Your Ad Here

Followers

Wednesday, September 29, 2010

Learning Python

First, a little introduction on my background in programming.  My first language was C++, and that was several years ago.  I used it for a year, maybe 2, and haven't even touched it since.  During that break I immediately learned some java, mainly basic syntax and some GUI.  After that I had a class on UNIX, where I learned some bash and got some VI experience.  All in all, I feel as if I know next to nothing about programming, so I can only offer my opinion on the best way to learn Python.

First, I tried working on Windows.  Installing Python was easy, finding idle wasn't quite so easy.  It's in the Lib\idlelib\ folder of the Python folder.  This alone isn't the problem with using windows.  However, this seems irrelevant when I want to run a file using command line of something like "python ex1.py" and it either shows as python is not a known command or ex1.py is not found.  I didn't want to have to deal with these issues in the beginning, so I went on my laptop loaded with a current version of CentOs with Python 2.4.  This was extremely easy to begin with; the terminal automatically recognizes the python command and execute files.  This also gave me practice in using VI, one of the most powerful word editors and definitely the most basic on UNIX.
So that's the start, at least as I remember it a few weeks ago.  From there, I skimmed some popular introduction guides found from reddit.  Based on my needs of having to do stuff, and then analyze how it’s done, I went with Zed A. Shaw's guide of Learn Python the Hard Way (http://learnpythonthehardway.org/home).  It provides several examples detailing each command with enough practice that you understand what the command does.  This was the most useful because it immerses you in experience.  Questions are asked between typing in order to help gauge your understanding on what is happening and why so you know what you're doing and not just typing.  The exercises go through quick if you have the time.  I typed them all and thought the progression could have gone a bit faster as the first 6 exercises were mainly on the print function and built in math.  If you have any previous programming experience, or a couple hours of free time a day, this will take less than 2 weeks to finish and understand.
The bigger problem is where to go from there.  You barely know the basic syntax and data storage.  There are many suggestions to read code, however you haven't seen all the data types or how they're possibly used.  Next, I'd suggest you quickly go through the intro chapters of How to Think Like a Computer Scientist (http://openbookproject.net/thinkcs/python/english2e/).  After that, slowly go through the new material so you can understand how data and memory are managed.  These are very important as you begin to deal with pointers and such.
That's as far as my expertise goes, I'll keep you posted on my progress as I continue to learn.  Another word of advice though, have a goal in mind.  What do you want to program? A game? What kind? Database? Address book? Website parser? Calculator for advanced equations? Daily Schedule?  Just have something in mind that you want to do, you're only as good and determined as the work you complete.

No comments:

Post a Comment