<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](asyncio-task.xhtml "協程與任務") | - [上一頁](ipc.xhtml "網絡和進程間通信") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [網絡和進程間通信](ipc.xhtml) ? - $('.inline-search').show(0); | # [`asyncio`](#module-asyncio "asyncio: Asynchronous I/O.") --- 異步 I/O - - - - - - Hello World! ``` import asyncio async def main(): print('Hello ...') await asyncio.sleep(1) print('... World!') # Python 3.7+ asyncio.run(main()) ``` asyncio 是用來編寫 **并發** 代碼的庫,使用 **async/await** 語法。 asyncio 被用作多個提供高性能 Python 異步框架的基礎,包括網絡和網站服務,數據庫連接庫,分布式任務隊列等等。 asyncio 往往是構建 IO 密集型和高層級 **結構化** 網絡代碼的最佳選擇。 asyncio 提供一組 **高層級** API 用于: - 并發地 [運行 Python 協程](asyncio-task.xhtml#coroutine) 并對其執行過程實現完全控制; - 執行 [網絡 IO 和 IPC](asyncio-stream.xhtml#asyncio-streams); - 控制 [子進程](asyncio-subprocess.xhtml#asyncio-subprocess); - 通過 [隊列](asyncio-queue.xhtml#asyncio-queues) 實現分布式任務; - [同步](asyncio-sync.xhtml#asyncio-sync) 并發代碼; 此外,還有一些 **低層級** API 以支持 *庫和框架的開發者* 實現: - 創建和管理 [事件循環](asyncio-eventloop.xhtml#asyncio-event-loop),以提供異步 API 用于 [`網絡化`](asyncio-eventloop.xhtml#asyncio.loop.create_server "asyncio.loop.create_server"), 運行 [`子進程`](asyncio-eventloop.xhtml#asyncio.loop.subprocess_exec "asyncio.loop.subprocess_exec"),處理 [`OS 信號`](asyncio-eventloop.xhtml#asyncio.loop.add_signal_handler "asyncio.loop.add_signal_handler") 等等; - 使用 [transports](asyncio-protocol.xhtml#asyncio-transports-protocols) 實現高效率協議; - 通過 async/await 語法 [橋接](asyncio-future.xhtml#asyncio-futures) 基于回調的庫和代碼。 參考引用 高層級 API - [協程與任務](asyncio-task.xhtml) - [流](asyncio-stream.xhtml) - [Synchronization Primitives](asyncio-sync.xhtml) - [子進程](asyncio-subprocess.xhtml) - [隊列集](asyncio-queue.xhtml) - [異常](asyncio-exceptions.xhtml) 低層級 API - [事件循環](asyncio-eventloop.xhtml) - [期程](asyncio-future.xhtml) - [傳輸和協議](asyncio-protocol.xhtml) - [策略](asyncio-policy.xhtml) - [平臺支持](asyncio-platforms.xhtml) 指南與教程 - [高級API索引](asyncio-api-index.xhtml) - [底層API目錄](asyncio-llapi-index.xhtml) - [用 asyncio 開發](asyncio-dev.xhtml) ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](asyncio-task.xhtml "協程與任務") | - [上一頁](ipc.xhtml "網絡和進程間通信") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [網絡和進程間通信](ipc.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看