TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #422 · 30 мар.

Если запустить REPL с модулем asyncio, то вы входите в особый асинхронный REPL. user@host:~$ python -m asyncio asyncio REPL 3.12.7 ... Use "await" directly instead of "asyncio.run()". >>> import asyncio >>> В этом режиме - создаётся и настраивается event loop - уже импортирован asyncio - работает await на верхнем уровне То есть такая команда сработает без ошибок! await asyncio.sleep(3) Удобно для тестирования асинхронных функций без создания ивентлупов и остальной обвязки. Работает в: 3.8+ #tricks#async

Резултати

Пронајдени 1 слични објави

Пребарај: #sigpipe

当前筛选 #sigpipe清除筛选
djangoproject

@djangoproject · Post #173 · 22.09.2016 г., 18:55

#signal — Set handlers for #asynchronous events This module provides mechanisms to use signal handlers in Python. The signal.signal() function allows to define custom handlers to be executed when a signal is received. A small number of default handlers are installed: #SIGPIPE is ignored (so write errors on pipes and sockets can be reported as ordinary Python exceptions) and #SIGINT is translated into a KeyboardInterrupt exception. #Asyncio https://docs.python.org/3.4/library/signal.html