라벨이 asyncio인 게시물 표시

파이썬[Python]: asyncio - run 함수

파이썬(Phthon): asyncio 모듈 - run 함수(function) /// 설명 코루틴 coro를 시행하고 결과를 반환합니다.(asyncio 이벤트 루프 관리, 비동기 제너레이터 정리, 쓰레드 풀 종료 -> main으로 사용하여야 합니다.) debug 인자가 True이면, 이벤트 루프는 디버그 방식으로 진행됩니다. ※ 형식 asyncio.run(coro, *, debug=False) reference https://docs.python.org/3/library/asyncio-task.html#asyncio.run /// 예제 1 2 3 4 5 6 7 8 import  asyncio   async  def  async_main():     await asyncio.sleep( 3 )      print ( 'This is the first using asyncio.' )   # This is the first using asyncio.   asyncio.run(async_main())   Colored by Color Scripter cs * 실행환경: Microsoft Windows 10 Homes * 인터프리터: 파이썬(Python 3.9) – 당신을 응원합니다. –