ch22: examples

This commit is contained in:
Luciano Ramalho 2021-02-28 21:45:34 -03:00
parent a751c86836
commit 5aaa4e4929

View File

@ -8,8 +8,10 @@ from netaddr import multi_probe
async def main(tld: str) -> None:
names = (f'{w}.{tld}'.lower() for w in kwlist if len(w) <= 4)
async for name, found in multi_probe(sorted(names)):
tld = tld.strip('.')
names = (w.lower() for w in kwlist if len(w) <= 4)
domains = (f'{name}.{tld}' for name in names)
async for name, found in multi_probe(domains):
mark = '.' if found else '?\t\t'
print(f'{mark} {name}')