This tutorial shows how to develop sockets-based networking applications using Python.
Python’s high-level networking classes simplify the development of applications requiring application-layer networking protocols. The tutorial covers the basic sockets features of Python (free reg. req.), using a sample chat application as a guide.
did you really think anyone would read an article that needs registration? eat a dick
Hum, cool. I was trying to translate a Java socket example to Python last week.
And about the f$%& free reg. req., just bugmenot.com it.
This service is temporarily unavailable. Please try again later.
🙁
Is there a PDF version of this Tutorial?
Whenever someone comes to me with a weird request about programming languages, I usually tell them to look at python, without really listening to what they’re saying. Usually they find the feature or paradigm that they want.
This all started when a coworker was writing a program to autogenerate some other code. He wanted the generated code to be purely functional (i.e. scheme, lisp, sml…) to simplify the code generation, but one of the functional elements needed to be a random number generator, and hence required a seed value. Creating and accessing this seed is a side-effect not technically allowed in functional programming. In functional programming, two identical function calls (with identical parameter values) return the same result, since these functions don’t have side effects. So, two calls to the random number generator return the same result… not good.
I told him to try python, purely since I knew it was a reasonable blend of functional and procedural programming styles. He came back the next day ecstatic at finding the parameter default value feature in python that lets the random number function use the seed if available and generate it if it’s not, all using a purely functional style.
There simply is no language that beats python in flexibility. You can solve the same problem infinite ways, and, unlike perl, most of them are readable also. You can argue that Ruby has nicer syntax or Boo is cool or whatever, but Python is the ultimate swiss army knife. If has more libraries, more bindings, and more modules that any comparable language.
…And it does sockets. Yes, socket programming is important. That was my rant for now, back to the discussion on python and sockets.