network programming

Tom Anderson twic at urchin.earth.li
Mon Aug 22 18:41:34 EDT 2005


On Mon, 22 Aug 2005, Steve Holden wrote:

> Tom Anderson wrote:
>
>> On Sun, 21 Aug 2005, John Walton wrote:
>> 
>>> Hello, everyone.  I just began school, and they already assigned us 
>>> science fair.  Since I'm in 8th grade, I get to do demonstrations for our 
>>> projects. I'm probably going to demonstrate Python's networking 
>>> capabilities by writing a simple instant messenger program.  I only have a 
>>> few problems:
>>> 
>>> 1. I know squat about Python network Programming
>>> 
>>> 2. I know nothing about networks
>>> 
>>> So if any of you know of a good Python Networking Tutorial or a website 
>>> with lots of information on networks and networking, please reply. Thanks!
>> 
>> [snipzilla!]
>> 
>> That's pretty much it for the network fundamentals. - but you can 
>> forget about that until you've mastered the basics.
>
> I tried to cover those basics as briefly as possible in the tutorial I 
> mentioned earlier.

Oops! I missed that.

> I'd appreciate your comments on how well I succeeded.

Comment #1: it's a combination of PDF and powerpoint! :) I intended to 
have a look at it, but i was in a but of a rush this morning, so i'm 
afraid i skipped over it. Right now, i'm using a computer that isn't 
capable of reading either format; i'll have a look at the tutorial this 
evening (i hope) and get back to you. Not that my opinion is worth much.

Okay, read it. Yes, that covers what we're talking about.

>> RFCs can be pretty heavy going, but they are *the* definitive 
>> specifications, so they're worth reading. Once you're used to them, they're 
>> often easier to read than tutorials, i find.
>
> Not for newbies, though very useful for ensuring high levels of 
> interoperability (and fascinating when you start to realize that real 
> products bend the RFCs in various ways).

Maybe i'm unusual, but i've *always* preferred specs to tutorials for most 
learning - specs are definitive, comprehensive and precise, whereas 
tutorials are often erroneous, patchy and waffly. Yes, they take more 
effort to read, but in the case of the RFCs, not that much, once you have 
a very basic level of knowledge - most RFCs are very clearly written. 
Perhaps the OP would be better off with tutorials, though - particularly 
for the programming side rather than the actual protocols.

>> The second thing is understanding how to do network programming in python. 
>> There's a well-established API in C for network programming - the socket 
>> API - which comes from UNIX; python uses a fairly simple translation of 
>> this as its network API (look in the 'socket' package). The good thing 
>> about this is that this API is well-understood and well-documented. The bad 
>> thing is that it's a bit of a mess (compare and contrast to the API in Java 
>> if you don't believe me). There's detailed documentation for the socket 
>> module here:
>> 
>> http://docs.python.org/lib/module-socket.html
>> 
> [...]
>
> But then Java's a bit of a mess as a language when compared with Python, 
> I should say.

Oh, absolutely - but the socket API is a rare breath of simplicity.

> While I know the language has many adherents, it also seems to have many 
> programmers who only know enough to follow recipes.

True, but let's save that rant for another day.

> This latter feature is a symptom of the language's popularity, so I 
> suppose we should expect the same problems in about twenty years when 
> Python becomes more popular than Java.

I know. I left comp.lang.java.programmer because it got overrun with 
clueless muppets. I don't have anything against newbies, but when a place 
is crawling with them to that extent, it's not fun. clp will be like that 
one day. i haven't decided if i'll take up Smalltalk or LISP next ...

tom

-- 
In Milan, [traffic lights] are instructions, in Rome suggestions, and in Naples Christmas decorations. -- James Dowden



More information about the Python-list mailing list