Live data from Hacker News

Python socket programming tutorial

binarytides.com

1–10 of 22 posts

Re: Python socket programming tutorial

#4
post #3

Shouldn't the first step be install http://www.zeromq.org/ ? That is some seriously amazing stuff right there. Makes network programming (something I've avoided for years) almost trivial.

More appropriately, the first step should be to install Twisted.

Re: Python socket programming tutorial

#5
post #3

Shouldn't the first step be install http://www.zeromq.org/ ? That is some seriously amazing stuff right there. Makes network programming (something I've avoided for years) almost trivial.

The point is (or should be) to learn how socket programming works so you know what's going on under all that abstraction and why. That's also why we catch all those exceptions: so we understand why something failed, and how to deal with it in the future. It's also really fun to write complex networking apps from scratch =)

Re: Python socket programming tutorial

#6
post #3

Shouldn't the first step be install http://www.zeromq.org/ ? That is some seriously amazing stuff right there. Makes network programming (something I've avoided for years) almost trivial.

More appropriately, the first step should be to install Twisted.

txZMQ is pretty cool if you are going the Twisted route. It's nice to reuse twisted's event loop instead of rolling your own.

Re: Python socket programming tutorial

#8

Decent tutorial, though I find the official Python HOWTO to be a more thorough and appropriate introduction to sockets for the complete newbie... http://docs.python.org/howto/sockets.html

As a python newbie, I couldn't disagree more.

I would have saved hours while working on (and possibly completed) the recent Stripe CTF. Frankly, I started to dislike the python docs thoroughly. However, I'm very much looking forward to the much-rumored new docs--I very much dig the language.

As an example to my point, however, look at the two side-by-side as an aspiring tinkerer with the desire to send data over a socket. To me, the aforementioned tutorial is miles ahead of the python docs.

Re: Python socket programming tutorial

#10

Decent tutorial, though I find the official Python HOWTO to be a more thorough and appropriate introduction to sockets for the complete newbie... http://docs.python.org/howto/sockets.html

As a python newbie, I couldn't disagree more. I would have saved hours while working on (and possibly completed) the recent Stripe CTF. Frankly, I started to dislike the python docs thoroughly. However, I'm very much looking forward to the much-rumored new docs--I very much dig the language. As an example to my point, however, look at the two side-by-side as an aspiring tinkerer with the desire to send data over a so…

We may have an unreconcilable difference in philosophy here. I understand there is value in jumping straight to code, but I find real value in a (good) treatment of the model you're coding against before jumping in.

Both tutorials are good, but I think a Python programmer totally new to network programming, which is the audience of the OP, is better served first reading that HOWTO before following the code samples...

Post reply on HN