[Tutor] Net mask in hex. to dec.

Jonas Melian jonasmg at SoftHome.net
Wed Aug 10 23:47:39 CEST 2005


Hi,

I get the netmask (mask="0xffffff00") from ifconfig in openbsd, and i 
would convert it to decimal (255.255.255.0)

I think that socket module doesn't help on this. So I'll have to make 
something as this for separate 'mask'

[s[i:i+2] for i in range(0, len(s), 2)]

then i could use int('', 16)



More information about the Tutor mailing list