views:

317

answers:

9

I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.

I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?

Thanks.

EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.

EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.

+7  A: 

I would recommend you understand the basics. What are methods, classes, variables and so on. It would be important to understand the constructs you are seeing. If you don't understand those then it's just going to be a bunch of characters.

Damien
Even though Python is not Perl, I like the use of "bunch of characters".
Martinho Fernandes
+2  A: 

I would start with reading the Python tutorial. This wiki page looks good, too.

Zach Hirsch
+2  A: 

To understand source code in any language, you first need to learn the language. It's as simple as that!

Usually, reading source code (as a sole activity) will hurt your head without giving much benefit in terms of learning the underlying language. You need a structured tour through carefully chosen small source code examples, such as a book or tutorial will give you.

Check Amazon out for books and Google for tutorials, try a few. The links offered by some of the other answers would also be a great starting point.

Carl Smotricz
+2  A: 

If you don't have any experience in programming, even the simplest code might be too hard to understand. Just start reading the docs/tutorial (http://docs.python.org/tutorial/index.html) and write your own small apps. You'll get hang of it soon and will be able to understand what others created.

viraptor
+2  A: 

There is no magic way to learn anything without reading and writing code yourself. If you get stuck there are always folks in SO who will help you.

fastcodejava
+2  A: 

Donald Knuth suggests:

"It [is] basically the way you solve some kind of unknown puzzle -- make tables and charts and get a little more information here and make a hypothesis."

(From "Coders at Work", Chapter 15)

In my opinion, the easiest way to understand a program is to study the data structures first. Write them down, memorize them. Only then, think about how they move through program-time.

As an aside, it is sort of a shame how few books there are on code reading. "Coders at Work" is probably the best so far. Ironically, "Reading Code" is one of the worst so far.

joe
A: 

Maybe you have a project in mind that you want to code up? It's very hard to read what other people write, the best way to learn is to try something. Other people will have gone through the problems you will come across, and so why code is written the way it is may start to make sense. This is an excellent site to post questions, no matter how stupid you consider them.

SpecialK