diff --git a/asyncio/README.md b/asyncio/README.md index d9da311..60a5764 100644 --- a/asyncio/README.md +++ b/asyncio/README.md @@ -1,6 +1,6 @@ ## nest_asyncio ```python -'Sync' +'sync' def Sync(): import asyncio, functools, importlib.util as U U.find_spec('nest_asyncio') or os.system('pip install -q nest_asyncio') @@ -21,9 +21,12 @@ async def Page(): if callable(method := getattr(page, attr)) and not attr.startswith('_'): setattr(page, attr, sync(method)) return page -page = Page() -page.goto('http://example.com') -print(page.title()) # Example Domain + +'main' +if __name__ == '__main__': + page = Page() + page.goto('http://example.com') + print(page.title()) # Example Domain ``` ## threading