#!/usr/bin/env python
+from __future__ import print_function
+
import dns.e164
n = dns.e164.from_e164("+1 555 1212")
-print n
-print dns.e164.to_e164(n)
+print(n)
+print(dns.e164.to_e164(n))
#!/usr/bin/env python
+from __future__ import print_function
+
import dns.resolver
answers = dns.resolver.query('nominum.com', 'MX')
for rdata in answers:
- print 'Host', rdata.exchange, 'has preference', rdata.preference
+ print('Host', rdata.exchange, 'has preference', rdata.preference)
#!/usr/bin/env python
+from __future__ import print_function
+
import dns.name
n = dns.name.from_text('www.dnspython.org')
o = dns.name.from_text('dnspython.org')
-print n.is_subdomain(o) # True
-print n.is_superdomain(o) # False
-print n > o # True
-rel = n.relativize(o) # rel is the relative name www
+print(n.is_subdomain(o)) # True
+print(n.is_superdomain(o)) # False
+print(n > o) # True
+rel = n.relativize(o) # rel is the relative name www
n2 = rel + o
-print n2 == n # True
-print n.labels # ['www', 'dnspython', 'org', '']
+print(n2 == n) # True
+print(n.labels) # ['www', 'dnspython', 'org', '']
# If this weren't a demo script, there'd be a way of specifying the
# origin for each zone instead of constructing it from the filename.
+from __future__ import print_function
+
import dns.zone
import dns.ipv4
import os.path
for k in keys:
v = reverse_map[k]
v.sort()
- print k, v
+ print(k, v)
#!/usr/bin/env python
+from __future__ import print_function
+
import dns.reversename
n = dns.reversename.from_address("127.0.0.1")
-print n
-print dns.reversename.to_address(n)
+print(n)
+print(dns.reversename.to_address(n))
#!/usr/bin/env python
+from __future__ import print_function
+
import dns.query
import dns.resolver
import dns.zone
names = z.nodes.keys()
names.sort()
for n in names:
- print z[n].to_text(n)
+ print(z[n].to_text(n))
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""See diff_zones.__doc__ for more information"""
+from __future__ import print_function
+
__all__ = ['diff_zones', 'format_changes_plain', 'format_changes_html']
try:
if not changes:
sys.exit(0)
if opts.html:
- print format_changes_html(oldn, newn, changes, opts.ignore_ttl)
+ print(format_changes_html(oldn, newn, changes, opts.ignore_ttl))
else:
- print format_changes_plain(oldn, newn, changes, opts.ignore_ttl)
+ print(format_changes_plain(oldn, newn, changes, opts.ignore_ttl))
sys.exit(1)