Add samba.ensure_third_party_module() function, loading external python modules from...
[sfrench/samba-autobuild/.git] / lib / dnspython / examples / name.py
1 #!/usr/bin/env python
2
3 import dns.name
4
5 n = dns.name.from_text('www.dnspython.org')
6 o = dns.name.from_text('dnspython.org')
7 print n.is_subdomain(o)         # True
8 print n.is_superdomain(o)       # False
9 print n > o                     # True
10 rel = n.relativize(o)           # rel is the relative name www
11 n2 = rel + o
12 print n2 == n                   # True
13 print n.labels                  # ['www', 'dnspython', 'org', '']