Checking for IPv6 in Python

| | Comments (1) | TrackBacks (0)

Here's a random little tip: To check if your platform's Python interpreter was built with IPv6 support, run this program:


$ python
Python 2.4.4 (#1, Jan 10 2007, 01:25:01) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.has_ipv6
True
>>> ^D

0 TrackBacks

Listed below are links to blogs that reference this entry: Checking for IPv6 in Python.

TrackBack URL for this entry: https://blogs.psu.edu/mt4/mt-tb.cgi/640

1 Comments

Jim Leous said:


python
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.has_ipv6
True
>>> ^D


Yeah!

Leave a comment