GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — example-code-2e/21-async/domains at master · FerMatPy/example-code-2e

Expand file tree

/

domains

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

domains

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
asyncio
asyncio
 
 
curio
curio
 
 
README.rst
README.rst
 
 

README.rst

domainlib demonstration

Run Python's async console (requires Python ≥ 3.8):

$ python3 -m asyncio

I'll see asyncio imported automatically:

>>> import asyncio

Now you can experiment with domainlib.

At the >>> prompt, type these commands:

>>> from domainlib import *
>>> await probe('python.org')

Note the result.

Next:

>>> names = 'python.org rust-lang.org golang.org n05uch1an9.org'.split()
>>> async for result in multi_probe(names):
...     print(*result, sep='\t')

Note that if you run the last two lines again, the results are likely to appear in a different order.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.