Creating a variable of a specific type

Richard Brodie R.Brodie at rl.ac.uk
Thu Feb 5 06:59:08 EST 2004


"Dan Williams" <dan at ithium.net> wrote in message
news:mailman.1236.1075978481.12720.python-list at python.org...

> ...this is an except of a sample of different types that I am using. From
> looking at the documentation for the Python socket module, for instance, I
> can see that the function socket.inet_ntoa() requires a variable in struct
> in_addr form, just like in C++.

It would be more helpful to say that inet_ntoa is a way to deal with a
variable in packed format. Unless you are deserializing from a buffer
(e.g for a binary wire protocol), or embedding 'C' code you probably
don't need to use it anyway.

It might be worth investing a few minutes playing with the example
socket programs from the Python docs, even if you are an experienced
programmer: http://www.python.org/doc/current/lib/socket-example.html








More information about the Python-list mailing list