PDA

View Full Version : What's the best book for learning Python?



Legendary_Bibo
May 24th, 2010, 02:29 AM
There's a lot on Amazon, but I don't know which is the best.

A list of the resources I've gotten from you guys

For those with programming knowledge and want to just jump right in

Here's how to do it:
step 1) read this:
http://www.sthurlow.com/python/
and so some experimentations with the examples there

step 2) go to http://projecteuler.net/ or find another site which offers easier exercises and start programming.

You'll encounter problems as you program so you'll have to refer back to http://www.sthurlow.com/python/
or find solutions on Google.

That's the best way to Learn Python.

A Tutorial straight from the repositories



sudo apt-get install diveintopython


A guide on JPython, and learning how to develop a GUI and code in Python simultaneously

http://www.dickbaldwin.com/python/Pyth0001.htm

Python Programming for kids

Snake Wrangling for Kids
http://www.briggs.net.nz/log/writing/snake-wrangling-for-kids/

http://baheyeldin.com/technology/teaching-kids-programming.html

http://rur-ple.sourceforge.net/


from the community manager jono bacon
http://www.jonobacon.org/2010/04/08/making-programming-easier-for-kids-with-pyjunior/

Python tutorials found in the Linux install itself

http://docs.python.org/tutorial/

http://docs.python.org/py3k/tutorial/

A very down to earth guide on understanding programming in general with a focus on Python

HTML ONLY
http://openbookproject.net//thinkCSpy/

Get the PDF format, and there's a few more guides
http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2008/Readings/

A couple of Paperback books about Python

http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996/ref=sr_1_1?ie=UTF8&s=books&qid=1274664656&sr=8-1

http://apress.com/book/view/1590599829

cprofitt
May 24th, 2010, 02:31 AM
I personally like this one (http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996/ref=sr_1_1?ie=UTF8&s=books&qid=1274664656&sr=8-1) -- but it is not just for learning Python. It is an introduction to programming.

wojox
May 24th, 2010, 02:32 AM
This is free from MIT How to Think Like a Computer Scientist: Learning with Python (http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2008/Readings/)

Legendary_Bibo
May 24th, 2010, 04:07 AM
This is free from MIT How to Think Like a Computer Scientist: Learning with Python (http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2008/Readings/)

I'm following it right now. Is there a good gui development environment? I tried QT4, but it's not as easy as Visual Studio. I liked how VS had the other window where you could edit what everything did. Right now I'm learning through the terminal.

handy
May 24th, 2010, 04:15 AM
Great course here for free:

http://www.dickbaldwin.com/python/Pyth0001.htm

Phrea
May 24th, 2010, 06:13 AM
Not a book.

http://openbookproject.net//thinkCSpy/

Legendary_Bibo
May 24th, 2010, 06:18 AM
Not a book.

http://openbookproject.net//thinkCSpy/

Someone beat you to the punch :)
That's the one I'm using, it's really down to earth, and goes step by step. I already got through the first 50 pages out of 280.

llanitedave
May 24th, 2010, 06:23 AM
I'd go with the official tutorials. You can do here for version 2.6 (http://docs.python.org/tutorial/), or
here for version 3.1 (http://docs.python.org/py3k/tutorial/).

Whether to start with 2.6 or 3.1 is a tough call. Version 3 is the direction it's heading for the future, but version 2 will be around for a long time yet. Problem is there are some major incompatibilities between the two.

The tutorials are well written introductory text, and they're more up to date than any published book.

As for IDEs, you really don't need anything fancy for a typical Python project. And you'll probably get 100 different recommendations from 50 different people. I use SPE (Stani's Python Editor), some like KDevelop, some like Eclipse, some like Emacs, some like gedit. A few even like IDLE.

I'd recommend just experimenting for a while and seeing what you like best.

madjr
May 24th, 2010, 07:23 AM
this is what you need


Snake Wrangling for Kids
http://www.briggs.net.nz/log/writing/snake-wrangling-for-kids/

http://baheyeldin.com/technology/teaching-kids-programming.html

http://rur-ple.sourceforge.net/


from the community manager jono bacon
http://www.jonobacon.org/2010/04/08/making-programming-easier-for-kids-with-pyjunior/

Legendary_Bibo
May 24th, 2010, 07:25 AM
this is what you need


Snake Wrangling for Kids
http://www.briggs.net.nz/log/writing/snake-wrangling-for-kids/

http://baheyeldin.com/technology/teaching-kids-programming.html

http://rur-ple.sourceforge.net/

How old do you think I am?

mihai.ile
May 24th, 2010, 08:27 AM
Not a book.

http://openbookproject.net//thinkCSpy/

Wow this looks that is well made, I think I will also read it, been wanting to learn python for a long time, this could be the time :)

Frak
May 24th, 2010, 08:38 AM
I read a book by Apress: http://apress.com/book/view/1590599829

Martje_001
May 24th, 2010, 08:40 AM
Dive Into Python


sudo apt-get install diveintopython
or get it at Amazon.

madjr
May 24th, 2010, 08:44 AM
How old do you think I am?

is not how old you're , but how many projects you made

learning to program is the same, no matter how you look at it :)

cguy
May 24th, 2010, 10:12 AM
You're placing too much emphasis on books.

Here's how to do it:
step 1) read this:
http://www.sthurlow.com/python/
and so some experimentations with the examples there

step 2) go to http://projecteuler.net/ or find another site which offers easier exercises and start programming.

You'll encounter problems as you program so you'll have to refer back to http://www.sthurlow.com/python/
or find solutions on Google.

That's the best way to Learn Python.

Legendary_Bibo
May 24th, 2010, 10:33 AM
Well I'm running through the beginning parts and just learning what the keywords are and the syntax because it's pretty similar to C++. You want to know one thing I haven't seen in any of these guides though? Arrays. My level 1 CS class professor was making us learn freaking arrays, and from what I've gathered, that's not level 1 stuff.

Calmor
May 24th, 2010, 10:47 AM
Arrays can be level 1 stuff, sure. It's generally the next logical step after learning what variables are (and types if your language uses those). Far better than string formatting... bah. Arrays are mighty useful even though they're slowly being abstracted away, and the theory behind them (big list of things) isn't all that difficult. Multi-dimensional with uneven-length dimensions can get tricky though if you have to implement it by hand.

Though I know little of Python, I can hack out a few things - just yesterday I made a quick script to manually concatenate two WAV files of the same bitrate. Anyway, Python uses arrays in the form of tuples or dictionaries. If you grasp the concept of these things, arrays are right alongside them, though slightly different.

What I love about Python is that knowing little of the language and little of how WAV files work, a quick dive into the help screeens and away you go.

mihai.ile
May 24th, 2010, 10:58 AM
This thread is quite interesting, I suggest that the OP to add all those references to the first post, so that would help organise them and easier to find later. I am sure many will appreciate it in the future.

Legendary_Bibo
May 24th, 2010, 11:00 AM
haha yeah I read a little bit on how to do things, but I get antsy and just want to code so I just hit random commands I know from C++ or try to guess the syntax of some of the other commands in hopes I get it on my own. There's some luck in this method. I never got arrays because the way my teacher showed us was how to write the command for an array, but not exactly what it was doing. So far I'm enjoying learning it over freaking C++. It was just syntax hell...I hate semicolons now. Also it has better error handling and it does math better without getting a bug in its *** like C++ does. What I've learned in an hour took a couple of lectures in C++ which makes you wonder why even teach it?

Legendary_Bibo
May 24th, 2010, 11:01 AM
This thread is quite interesting, I suggest that the OP to add all those references to the first post, so that would help organise them and easier to find later. I am sure many will appreciate it in the future.

Good idea.

Calmor
May 24th, 2010, 11:54 AM
What I've learned in an hour took a couple of lectures in C++ which makes you wonder why even teach it?

Depending on who you talk to, and what your overall goal is, some will tell you that learning C (even more so than C++) is a good way to start and understand what it really is that you're doing.

Others will say there's no need to dive into that complexity right off the bat.

C (and to a lesser extent, C++) are on-the-hardware type languages. You allocate your own memory, and code is translated directly into machine language before you can execute it.

Python is more of a scripting language. It's interpreted on the fly, and as necessary. I believe you can "compile" it down to a bytecode like Java, but it's still interpreted, as the bytecode is meant to be cross-platform.

There are pros and cons to both camps. As a CS major, you're most likely going to be learning how these things interact on an actual piece of silicon. In the world of embedded systems, memory is a finite resource, and interpreted languages are a rarity. There are chips that run Java, but they're far fewer than ones that run a standard or reduced instruction set. This means you'll probably need to know and understand how and why C does what it does. In Python, you don't care what type the interpreter assigns to your variable. But when you have 8k of RAM, you can't use word-length variables when a byte will do.

If all you really care about, though, is making functional scripts in Linux, it's hard to argue with Python's "up-and-running-fast" method of doing things.

cguy
May 24th, 2010, 12:57 PM
arrays can be level 1 stuff, sure. It's generally the next logical step after learning what variables are (and types if your language uses those). Far better than string formatting... Bah. Arrays are mighty useful even though they're slowly being abstracted away, and the theory behind them (big list of things) isn't all that difficult. Multi-dimensional with uneven-length dimensions can get tricky though if you have to implement it by hand.

Though i know little of python, i can hack out a few things - just yesterday i made a quick script to manually concatenate two wav files of the same bitrate. Anyway, python uses arrays in the form of tuples or dictionaries lists. If you grasp the concept of these things, arrays are right alongside them, though slightly different.

What i love about python is that knowing little of the language and little of how wav files work, a quick dive into the help screeens and away you go.
:p

Calmor
May 24th, 2010, 02:56 PM
Thanks for the correction! Like I said, I'm rather green in Python - I just tend to turn to it when I want to see if I understand the theory of something, or if I need a quick command-line file to get things done quickly.

gnomeuser
May 24th, 2010, 03:18 PM
That reminds me I have O'Reillys Programming Python 2nd edition lying in my closet. I bought it but upon experimenting with python a bit I found that I couldn't stomach reading the syntax without thinking mankind was doomed.

If anyone wants it they can pick it up or pay for shipping.

Legendary_Bibo
May 28th, 2010, 07:30 PM
Depending on who you talk to, and what your overall goal is, some will tell you that learning C (even more so than C++) is a good way to start and understand what it really is that you're doing.

Others will say there's no need to dive into that complexity right off the bat.

C (and to a lesser extent, C++) are on-the-hardware type languages. You allocate your own memory, and code is translated directly into machine language before you can execute it.

Python is more of a scripting language. It's interpreted on the fly, and as necessary. I believe you can "compile" it down to a bytecode like Java, but it's still interpreted, as the bytecode is meant to be cross-platform.

There are pros and cons to both camps. As a CS major, you're most likely going to be learning how these things interact on an actual piece of silicon. In the world of embedded systems, memory is a finite resource, and interpreted languages are a rarity. There are chips that run Java, but they're far fewer than ones that run a standard or reduced instruction set. This means you'll probably need to know and understand how and why C does what it does. In Python, you don't care what type the interpreter assigns to your variable. But when you have 8k of RAM, you can't use word-length variables when a byte will do.

If all you really care about, though, is making functional scripts in Linux, it's hard to argue with Python's "up-and-running-fast" method of doing things.

I'm a Bioengineering major, but after learning a bit of programming I started becoming interested in it as a hobby. I'll return to C++ and learn C someday, but for now I would like to learn a language that lets me do cool things (which is why it's a good language to teach little kids :) ). I'm going to learn computer programming at a steady pace, so if I understand the entire logic that goes into programming through an easier language such as Python then I figure I won't be as frustrated when I go through more powerful languages such as C and C++.