inet_addr() in Python

Steve Holden steve at
Mon Jul 23 22:14:56 CEST 2007

brad wrote:
> Does Python have an equivalent to C's inet_addr()?
socket.inet_aton() produces a four-byte string you can pass as a struct 
in_addr, if that's what you are looking for. If you want a number then 
use the struct module to manipulate it further.

 >>> s.inet_aton('')

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd 
Skype: holdenweb
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

More information about the Python-list mailing list