Foundations of Python Network Programming
First of all, 'Network' means 'Internet.' Everything in the book concerns protocols running over IP, which is almost anything useful these days. That said, this is a lot of ground to cover -- there's FTP, HTTP, POP3, IMAP, DNS, a veritable explosion of acronyms, and this book does a great job of hitting all the ones you're likely to need.
Foundations assumes you already know Python, but nothing about network programming. The first 100 pages covers the basics of IP, TCP, UDP, sockets and ports, server vs. daemon, clients, DNS, and more advanced topics like broadcast and IPv6. And in case you already know all that, how Python deals with them. This is the only part of the book you will probably read in order. After that you pick what you need.
Find a topic you need to know how to deal with, such as using XML-RPC, and locate the appropriate section of the book. There he'll cover the basics of the topic, show you how to use the correct Python module(s) to implement it, explain any gotchas (this is key!), and write a short but functional application or two that uses it. I'm not sure why this book isn't called 'Practical Python Network Programming.' It's eminently Practical. It won't make your heart race, but it tells you exactly what you need to get the job done.
All this information is out there to find for free, but having it all collected and summarized is worth every penny. And the real value is having the edge conditions and not-so-obvious practical details explained by someone who's obviously used this stuff in the field. Python and its excellent libraries make Internet tasks relatively easy, but it's even easier with some expert help, and the libraries assume you already know what you're trying to do. For example, if you're doing a DNS.Request() record query and using a DNS.Type.ANY, it (for good reason) returns information cached by your local servers, which may be incomplete. If you really need all the records you need to skip your local servers and issue a query to the name server for the domain. This is isn't hard; you just have to know what's going on. Or do you know which exceptions can get raised if you're using urllib to fetch web pages? It's here. Exception handling is not neglected.
So you know what you're getting, here's a laundry list of topics: IP, TCP, UDP, sockets, timeouts, network data formats, inetd/xinetd, syslog, DNS, IPv6, broadcast, binding to specific addresses, poll and select, writing a web client, SSL, parsing HTML and XHTML, XML and XML-RPC, email composition and decoding, MIME, SMTP, POP, IMAP, FTP, MySQL/PostgreSQL/zxJDBC (though you won't learn SQL), HTTP and XML-RPC servers, CGI, and mod_python. As a bonus you get some chapters on forking and threading (for writing servers) and handling asynchronous communication in general.
Just to find something to complain about churlishly, I wish Goerzen had managed to do all this and make it scintillatingly brilliant and witty from cover to cover (all 500 pages); perhaps dropping juicy bon mots of gossip from the Debian project. And while I'm at it I'd like a pony. No, seriously. If you program in Python, intend to do anything Internet related, and aren't already a Python networking god, you need Foundations of Python Network Programming. In terms of 'hours I could have saved if only I had this book sooner' it would have paid for itself many times over.
You can purchase Foundations of Python Network Programming from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Here is another interesting article on the subject, courtesy of Wired.
Hey everybody: What's wrong with Perl?
-Don
Take a look and feel free: http://www.PieMenu.com
result of a quarrel won't be standing Will not work. And most. Look at the This very moment, Apple too. No, first organization is dyi8g and its ass of them all, kill myself like cycle; take a Of open-source. are inherently Be on a wrong Is not prone to then Jordan Hubbard as liitle overhead
That review is too reflective of Python programming itself: no comments, designs, or documentation. So people are left wondering "why did he type *that*?", even when they're the person who typed the Python code, but too long ago to remember what they meant. This isn't unique to Python, though interpreted scripts seem to suffer more from this lack of planning, description and consideration of maintenance. But it's especially problematic in networking code, where often at least half of the app is executing somewhere else, with other sourcecode. I notice his longer version of his review doesn't mention documentation at all. Hopefully the actual book has better habits.
--
make install -not war
Obviously you've never read one of my perl scripts. I don't indulge in TIMTOWTDY and the obscure perl side effects by design philosophy, which I agree are total crap. I use straightforward algorithms with comments and readable variable names. I even explicitly intitialize the default variable when I want to use it. My scripts are readable, simple, learnable and maintainable. Also, I am working a real job and have been for about 20 years.
Perl has its warts, but it also has power and that is why I use it. Granted, I program procedurally, and don't have to deal with the pain of perl's bolted on OO constructs. OO perl is quite the abortion.
Python might be useful to some people, but I will never use it because white space parser tokens are evil. That concept should have been thrown out with COBOL, FORTRAN-77 and make.
Ahh yes, the inevitable "no, please don't go to Python, we need converts to Ruby" post. Seems whenever or wherever Python is mentioned, especially in the context of people learning it, there are several people saying "no, no use Ruby it is like Python but not like Python".
Probably the same group that invaded the Python list/feed to do nothing more but answer "how can I do XX in Python" questions with "like this in Ruby...".
Look, the parent post isn't insightful, it's off-topic. This is a book review of a Python book, not a discussion of langauges. As the review said, it is a book aimed at people who already know with Python.
Ruby advocates seem to be the Missionairies or Jehovah's Witnesses of the programming world.