[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Great Python books for the beginner

Delta

1/12/2008 7:04:00 AM

Hi, I'm a freshman in college and I'm going to be taking an intro to
programming course next semester which mainly uses Python, so I
thought it might be a good time to pick up Python beyond the scope of
the class as well. The text book for this class is Python for the
Absolute Beginner or something similar to that name.

I was wondering if anyone had any opinions on what other titles I
could look into since this one seems from a glance at reviews to be
teaching mainly through game programming (a topic I'm not too
interested in) or if this one is a quality book by itself.
14 Answers

Jim

1/12/2008 12:22:00 PM

0

Look at
http://www.pytho...
.. The tutorial is quite good.

Jim

Ben Finney

1/12/2008 1:48:00 PM

0

Landon <projecteclipsor@gmail.com> writes:

> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quality book by itself.

The book "Learning Python" is currently proving very useful to an
associate of mine. I'm watching his knowledge of Python grow
substantially every week, from what was an essentially zero start.

Learning Python, 3rd Edition
Mark Lutz
O'Reilly
<URL:http://www.oreilly.com/catalog/97805965...

Looking through the text, it is very well structured, thoroughly
teaching all the fundamentals of the language and types and idioms
while referring back to already-learned material. The author makes a
living training people in Python, and the third edition has benefited
from his many years of experience finding effective ways to teach the
language.

--
\ "If you ever teach a yodeling class, probably the hardest thing |
`\ is to keep the students from just trying to yodel right off. |
_o__) You see, we build to that." -- Jack Handey |
Ben Finney

sween119

1/12/2008 2:29:00 PM

0

On Jan 12, 2:03 am, Landon <projecteclip...@gmail.com> wrote:
> Hi, I'm a freshman in college and I'm going to be taking an intro to
> programming course next semester which mainly uses Python, so I
> thought it might be a good time to pick up Python beyond the scope of
> the class as well. The text book for this class is Python for the
> Absolute Beginner or something similar to that name.
>
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quality book by itself.

Hi Landon,

I've found the O'reilly books to be useful I have the Python Pocket
reference, which is helpful for me to remember the parameters
surrounding commands and all that.

I've been known to peruse the "Learning Python" book by the same
publisher and I really like "Programming Python" (though it is
thoroughly hefty and runs about $60USD)

But <http://www.pyth... has excellent documentation and if I may
put a word in for <http://www.pyga... to check out if you would be
at all interested in starting game programming.

-Sween

Mike Driscoll

1/12/2008 2:33:00 PM

0

On Jan 12, 7:47 am, Ben Finney <bignose+hates-s...@benfinney.id.au>
wrote:
> Landon <projecteclip...@gmail.com> writes:
> > I was wondering if anyone had any opinions on what other titles I
> > could look into since this one seems from a glance at reviews to be
> > teaching mainly through game programming (a topic I'm not too
> > interested in) or if this one is a quality book by itself.
>
> The book "Learning Python" is currently proving very useful to an
> associate of mine. I'm watching his knowledge of Python grow
> substantially every week, from what was an essentially zero start.
>
> Learning Python, 3rd Edition
> Mark Lutz
> O'Reilly
> <URL:http://www.oreilly.com/catalog/97805965...
>
> Looking through the text, it is very well structured, thoroughly
> teaching all the fundamentals of the language and types and idioms
> while referring back to already-learned material. The author makes a
> living training people in Python, and the third edition has benefited
> from his many years of experience finding effective ways to teach the
> language.
>
> --
> \ "If you ever teach a yodeling class, probably the hardest thing |
> `\ is to keep the students from just trying to yodel right off. |
> _o__) You see, we build to that." -- Jack Handey |
> Ben Finney

I would recommend Lutz's other book, the wonderful Python tome
"Programming Python 3rd Ed." as well. It's good for getting into the
deepest part of Python's jungle.

Mike

babycode

1/12/2008 7:41:00 PM

0

On Jan 12, 2:03 am, Landon <projecteclip...@gmail.com> wrote:

> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quality book by itself.

http://www.diveintop...

GeneralCody

1/12/2008 7:50:00 PM

0

On 2008-01-12 08:03:42 +0100, Landon <projecteclipsor@gmail.com> said:

> Hi, I'm a freshman in college and I'm going to be taking an intro to
> programming course next semester which mainly uses Python, so I
> thought it might be a good time to pick up Python beyond the scope of
> the class as well. The text book for this class is Python for the
> Absolute Beginner or something similar to that name.
>
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quality book by itself.

I would definetly go for Learning Python first, maybe Apress "Python,
from novice to Professional" as well...



Delta

1/12/2008 8:05:00 PM

0

One thing I wonder about is the examples these books use to teach the
concepts. I found myself really attached to K&R because the end of
section projects were utilities that I would find be able to find
useful in day to day work such as a version of wc and a program that
would take collapse all consecutive whitespace in a document into one
space. I could just use the projects from K&R, but I imagine a Python
book would have a better selection that highlight Python's abilities.

On another note, I would prefer to have a paper book so I don't have
to keep switching back and forth between documents on my computer.

André

1/12/2008 8:51:00 PM

0

On Jan 12, 4:04 pm, Landon <projecteclip...@gmail.com> wrote:
> One thing I wonder about is the examples these books use to teach the
> concepts. I found myself really attached to K&R because the end of
> section projects were utilities that I would find be able to find
> useful in day to day work such as a version of wc and a program that
> would take collapse all consecutive whitespace in a document into one
> space. I could just use the projects from K&R, but I imagine a Python
> book would have a better selection that highlight Python's abilities.
>
> On another note, I would prefer to have a paper book so I don't have
> to keep switching back and forth between documents on my computer.

You don't need to switch back and forth ... if you use Crunchy!

http://code.google.com...

To see it in action, http://showmedo.com/videos/video?name=1430000&fromSe...

(the third video in that series shows how to quickly get started using
the official Python tutorial).

André

Dennis Lee Bieber

1/12/2008 9:07:00 PM

0

On Sat, 12 Jan 2008 14:04:42 -0600, Landon <projecteclipsor@gmail.com>
declaimed the following in comp.lang.python:


> would take collapse all consecutive whitespace in a document into one
> space. I could just use the projects from K&R, but I imagine a Python

import sys
for ln in sys.stdin:
sys.stdout.write(" ".join(ln.split())) #if split() keeps the \n
# sys.stdout.write(" ".join(ln.split()) + "\n") #if \n is trimmed

You need a book to show this as a significant example? (NOTE: I'm
typing these off the top of my head, and haven't actually run them,
hence the option above)

"wc" is probably similar -- especially if you don't mind loading the
entire thing at one go...

import sys
print len(sys.stdin.read().split())

Line-by-line would be

import sys
sm = 0
for ln in sys.stdin:
sm += len(ln.split())
print sm

(I'm presuming wc just gives a total of the number of words in the
file... If you want a list of occurrences of each word, then it gets a
bit trickier... do you include punctuation, and case differences?)

Those utilities listed in K&R required actual manipulation of the
data, manual comparisons of characters and logic to determine if one
were in or out of a word, etc. All this work is handled by the Python
library, making the utilities trivial to code -- and probably not worth
coding the above: the time to load the Python interpreter and byte-code
compile the program could be a significant part of the run-time.

Word frequency, first cut (keeping case and punctuation):

import sys
wf = {}
for ln in sys.stdin:
for wd in ln.split():
wf[wd] = wf.get(wd, 0) + 1
kys = wf.keys()
kys.sort()
for ky in kys:
print "%40s : %10s" % (ky, wf[ky])

--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-asst@bestiaria.com)
HTTP://www.bestiaria.com/

bruno.desthuilliers@gmail.com

1/12/2008 9:12:00 PM

0

On 12 jan, 21:04, Landon <projecteclip...@gmail.com> wrote:
> One thing I wonder about is the examples these books use to teach the
> concepts. I found myself really attached to K&R because the end of
> section projects were utilities that I would find be able to find
> useful in day to day work such as a version of wc and a program that
> would take collapse all consecutive whitespace in a document into one
> space. I could just use the projects from K&R, but I imagine a Python
> book would have a better selection that highlight Python's abilities.

It wouldn't make any sens to port the K&R stuff to Python - different
languages, different uses, different problems... I mean, C is a low-
level language, mostly useful for low-level system programming, while
Python is a very high level language mostly useful for application
programming and Q&D scripting. So the applicative examples from K&R
are such no-brainers in Python they wouldn't teach you much, and the
more low-level examples (memory handling etc) just don't make sens in
Python because that's definitively not something you'd write in
Python.

But anyway: if you're looking for more real-life-like examples, Mark
Lutz's "Programming Python" might be worth a look.