
| Current Path : /proc/thread-self/root/usr/share/doc/python3-dnspython/examples/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/usr/share/doc/python3-dnspython/examples/name.py |
#!/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
n2 = rel + o
print(n2 == n) # True
print(n.labels) # ['www', 'dnspython', 'org', '']