Update asyncio/README.md

This commit is contained in:
2024-10-04 01:55:27 -04:00
parent 8eb570361b
commit 86322c0daf

View File

@@ -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