1

Just as we use socket.inet_aton() for converting Ipv4 string is there any way to convert the IPv6 address string in Windows.

The function socket.inet_pton() is only available for Unix.

So is there any other way for me to do that on windows and python 2.6 ???

1 Answer 1

2

IPy can do all sorts of IP address manipulations.

Also, inet_pton() is available as of Windows Vista, but Python targets older releases as well.

Sign up to request clarification or add additional context in comments.

8 Comments

I am using Windows7 and I tried to use inet_pton in python 2.6 but it raised an Atrribute Error so is there any workaround without installing new library ?
You could try using ctypes to bind to the relevant function in ws2_32.dll.
Sorry but I don't know how to do what you have written ... Could you give me an example or perhaps links to what I should do ? Thanks a lot...
Yup am reading it and I have loaded the dll using ctypes.... then i wrote 'a = ctypes.WinDLL("ws2_32.dll") import socket a.inet_pton(socket.AF_INET6,"122.122.122.122.122.122")' and I get 4 bytes parameter less.... Could you tell what am i missing here?
The third argument to the function.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.