HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
Python Cookbook, Third Edition

David Beazley, Brian K. Jones · 112 HN points · 1 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "Python Cookbook, Third Edition" by David Beazley, Brian K. Jones.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms. Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works. Topics include: Data Structures and Algorithms Strings and Text Numbers, Dates, and Times Iterators and Generators Files and I/O Data Encoding and Processing Functions Classes and Objects Metaprogramming Modules and Packages Network and Web Programming Concurrency Utility Scripting and System Administration Testing, Debugging, and Exceptions C Extensions
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
I'm in a very similar position.

If you really like Codeacademy, there are non-track exercises that involve Python in the API section [0] and a couple of Python challenges [1][2] that aren't listed.

What I'm doing now:

* Solving exercises on Project Euler in Python. [3]

* Working through each example in the Python Cookbook[4]. It was just updated to the third edition.

* Watched Guido's Painless Python talks from a few years ago [5]. I found his concise explanations of language features really helpful.

Some things I intend to do:

* Finish working through Collective Intelligence [6]. The examples are written in Python.

* Work through Introduction to Algorithms [7]. The course uses Python.

* Read, understand and give a shot at extending Openstack [8] code.

-----

0: http://www.codecademy.com/tracks/apis

1: http://www.codecademy.com/courses/python-intermediate-en-NYX...

2: http://www.codecademy.com/courses/python-intermediate-en-VWi...

3: http://projecteuler.net/

4: http://amzn.com/1449340377

5: http://www.youtube.com/watch?v=bDgD9whDfEY

6: http://amzn.com/0596529325

7: http://ocw.mit.edu/courses/electrical-engineering-and-comput...

8: http://en.wikipedia.org/wiki/OpenStack

westurner
You can search announced, in progress, future, self-paced, and finished MOOCs (Massive Open Online Courses) with class-central.com : http://www.class-central.com/search?q=python
kilkurdu
Aren't Project Euler's exercises seem more likely maths exercises? It's kinda difficult for those who graduated from social sciences and tries to learn programming from scratch.
westurner
The Green Tea Press books are great; and free.

Think Python: How To Think Like a Computer Scientist http://www.greenteapress.com/thinkpython/thinkpython.html

Think Complexity: Exploring Complexity Science with Python : http://www.greenteapress.com/compmod/

Think Stats: Probability and Statistics for Programmers : http://www.greenteapress.com/thinkstats/index.html

brandoncapecci
Yep. Project Euler is a waste of time if you're trying to get up to speed in learning programming.
incision
>Aren't Project Euler's exercises seem more likely maths exercises?

Project Euler does involve a math, but so does efficient programming.

Efficiency can seem a pretty abstract thing and it might not crop up right away in more typical programming tasks. Working a Euler problem and refining to a solution that runs in 1% or 0.001% of the time required for the most straightforward solution is a great demonstrator.

>It's kinda difficult for those who graduated from social sciences and tries to learn programming from scratch.

Sure, but the context of the question here isn't really from scatch. The OP has already completed at least the 296 exercises in the Python track at Codeacademy to establish a base.

Personally, I haven't graduated from anything and I treat the Euler exercises as an interesting way to practice/learn a bit of programming and math.

May 29, 2013 · 112 points, 32 comments · submitted by pydanny
inglesp
Congratulations to David Beazley!
ryankask
A bit strange that it costs $28.91 on Amazon.com but £38.50 on Amazon.co.uk.
scrapcode
There's an app for that. http://www.cheapriver.com/#?q=python%20cookbook
tharshan09
Thanks - purchased through amazon.com for £28 with shipping. amazon.co.uk would have been £38 and apparently taken longer to deliver.
fuzzix
Or just go to bookdepository.

Seeing it for ~€30, which is ~£25

euroclydon
I write a lot of code in C# and am just starting to learn how to use the latest async tools in the language. There are now built-in parallel sorting implementations [1]. So I looked for similar recipes in this book. I see on page 512 something called ProcessPoolExecutor() which looks promising...

1. http://msdn.microsoft.com/en-us/library/dd460688.aspx

brown9-2
O'Reilly is selling the ebook for more than Amazon is selling the print book: http://shop.oreilly.com/product/0636920027072.do
manojlds
And they are pretentious enough to say "Save a tree - Go digital"
revskill
I love Python's philosophy. But i always prefer Rails for my web projects. Maybe i'm addicted to Ruby and Rails. Could someone show me the way to be additecd to Python ?
telemaker
https://news.ycombinator.com/item?id=5247393 I like python so I use Django. I think Django was always on a better path security wise due to some good decisions early on.
carioca3
Udacity's Web Development course is what got me addicted to python. It teaches you how to build a blog using python + google's app engine.
boothead
Use pyramid. It's exceptionally well designed. It has very sensible defaults out of the box, but literally everything about the framework is swappable if you need it to be.

I can't comment on rails, but I spent quite a long time with django before switching to repoze-bfg (pyramid's previous name). In my experience you don't hit the same wall that you tend to with django when you need to step off the the common path.

jam-python
Just ordered this, based on the previous editions feedback.
frou_dh
Affiliate linked I see.
sp332
So? It's relevant, it's not like the user is just spamming HN to get affiliate hits.
iTrollFreely
hey, let's all just start submitting links to every new book that comes out on amazon with our affiliate links!
pydanny
I didn't know this was something you weren't supposed to do. Seriously, if I could delete this link, I would.

If this is a problem, I'll donate all proceeds to the charity of your choice. I'll post images of how much is earned.

masklinn
I believe moderators can edit links, no idea how to reach them though.
pydanny
Let me see what I can do on my end. Again, I'm willing to give all proceeds to the PSF or whoever.

Are there published guidelines on this or is this one of those unwritten rules I've stumbled into?

masklinn
Pretty sure it's an unwritten rule thing.
scrapcode
It's general courtesy to provide the original link first, and then offer an affiliate link as an option. In a community suck as HN, anyhow. I don't have problem giving you commish by any means. Enjoy.
frou_dh
No worries. I think it's usually considered bad form on news aggregators.
boothead
That's very kind. I have a better suggestion though: How about you distribute the proceeds in proportion to the total points of authors with upvoted posts suggesting that people go any buy the book? My comment above has two points already!

Even better - the algorithm you write could go into the 4th edition of the Cookbook :-)

P.S. Everyone should go any buy the book. (I want this comment to count too!)

pydanny
Great idea, but it turns out to be not that much was to be had by the amount of grief and shame I've accumulated: just $66.66 so far.

I seriously need to write down a list of "unwritten rules that get you spanked". :P

boothead
The Python Cookbook has been a great resource in both of the previous editions. I've been following Dave's pain in writing this on twitter, so I have no doubt that this one will be the same. This is a "must have" on any python hacker's bookshelf!
topherjaynes
Second the must have. I used it to get back into Python after a while. I was able to go through the rough cuts version on Safari Online and it's amazing. Poses a problem then gives you a straightforward, elegant solutions.
baldfat
When will the Kindle edition be 3rd?
mrgoldenbrown
You can get a mobi or other ebook format from O'Reilly right now: http://shop.oreilly.com/product/0636920027072.do
mixedbit
Is this a good book for someone that uses the language for quite some time, but never studied it deeply?

I'm looking for something like 'Effective C++' (but for Python of course): a collection of recipes and good practices that would allow an experienced programmer make a better use of the language.

gbog
Martelli's Python in a nutshell is the best I have seen on python. Not a cookbook, more of a reference, but this guy is extremely precise and rereading is always deepening my understanding of python.
martincmartin
Unfortunately, the most recent edition only covers 2.4 & the at-the-time proposed 2.5.

The best equivalent now is the language reference at python.org.

boothead
Yes, absolutely. There are a multitude of hidden gems in this book.
lambda_cube
Well, what kind of book has a collection of recipes? A cookbook, right? :-)

I haven't used any edition of the Python cookbook, but I've used the Perl cookbook and it's just like you described. I have also heard and read that the O'Reilly cookbooks are known (famous even?) for being the kind of books that you described.

HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.