Programming newbie coming from Ruby: a few Python questions

Bruno Desthuilliers onurb at xiludom.gro
Wed Aug 2 04:01:43 EDT 2006


simonharrison at fastmail.co.uk wrote:
> Hi all. I've been try to learn ruby for a few months but I'm about
> ready to give up. The available books either assume a programming
> background, or are out of date. Anyway, I think python may suit me more
> due to its 'theres one way to do it' philosophy (hope the quote is
> right)! 

Actually it's :
"There should be one-- and preferably only one --obvious way to do it."

And FWIW, it's followed by:
"Although that way may not be obvious at first unless you're Dutch."

!-)

NB : launch your Python interactive shell and type:

 import this

to get the whole thing.


> Another quote that I liked was:
> 
>  'Clever is not considered a compliment in Python.' (don't know where I
> read that...)

I don't remember having read this, but it probably refers to Brian
Kernighan:
"Debugging is twice as hard as writing the code in the first place.
 Therefore, if you write the code as cleverly as possible, you are,
 by definition, not smart enough to debug it."


> In Ruby, there are many ways to do the same thing and cleverness seems
> to be held in high regard. These attitudes are not too helpful for
> beginners in my experience. Anyway, enough waffle.
> 
> What books and tutorials are recommended to learn Python? 

There are some recommandations on python.org:
http://wiki.python.org/moin/PythonBooks
http://www.python.org/doc/intros/

Mark Lutz's "Programming Python" was a mostly good intermediate book,
but it's a bit outdated now.

> The tutorial
> that comes with Python is great and has given me a good overview but I
> think I'd benefit from some programming projects, now I have a little
> understanding of how Python works.
> 
> Ideally, I'd like a whole series of projects where I'm walked through
> how to go about writing real Python. The way I look at it, nobody
> learnt to build a house just from reading about building materials!

Indeed. But you don't necessarily need to follow a tutorial for this -
just think of some programs you'd like to write, and try to write them.
You can ask for help and submit (at least parts of) your work for review
here. FWIW, examples in books and tutorials are usually meant to help
you graps some points, features, idioms and gotchas, and are seldom as
complex and complete as "real" programs.

> Any other tips for getting up to speed with Python fairly quickly will
> be greatly appreciated.

Lurking here may be a good idea...

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list