per page, with , order by , clip by
Results of 1 - 10 of about 15 for Finished (0.007 sec.)
コルーチンとタスク 13897
コルーチンとタスク この節では、コルーチンと Task を利用する高レベルの asyncio の API の概略を解説します。 コルーチン ソースコード: Lib/asyncio/coroutines.py async/await 構文で宣言された コルーチン は、 asyncio を使ったアプリケーションを書く ... "started at { time . strftime ( ' %X ' ) } " ) await say_after ( 1 , 'hello' ) await say_after ( 2 , 'world' ) print ( f "finished at { time . strftime ( ' %X ' ) } " ) asyncio . run ( main ()) 予想される出力: started at 17 : 13 : 52 hello world finishe ... t { time . strftime ( ' %X ' ) } " ) # 両方のタスクが完了するまで待つ (約 2 秒かかる)。 await task1 await task2 print ( f "finished at { time . strftime ( ' %X ' ) } " ) 予想される出力が、スニペットの実行が前回よりも 1 秒早いことを示していることに注意して ... ください: started at 17 : 14 : 32 hello world finished at 17 : 14 : 34 asyncio.TaskGroup クラスは、 create_task() に代わるより新しい手段です。 この API を使うと、直前の例は次のよ ...
https://man.mtool.work/python/3.14/library/asyncio-task.html
asyncio での開発 11407
asyncio での開発 非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。 このページはよくある間違いや落とし穴を列挙し、それらを回避する方法を説明します。 デバッグモード asyncio はデフォルトで本運用モードで実行されます。いっ ... main (): asyncio . create_task ( bug ()) asyncio . run ( main ()) 出力: Task exception was never retrieved future : < Task finished coro =< bug () done , defined at test . py : 3 > exception = Exception ( 'not consumed' ) > Traceback ( most recent call l ... てください: asyncio . run ( main (), debug = True ) デバッグモードの出力: Task exception was never retrieved future : < Task finished coro =< bug () done , defined at test . py : 3 > exception = Exception ( 'not consumed' ) created at asyncio / tasks . py ... cio . run ( main ()) この例の出力は次のようになります。 unhandled exception during asyncio . run () shutdown task : < Task finished name = 'Task-3' coro =<< async_generator_athrow without __name__ > () > exception = AssertionError () > Traceback ( most r ...
https://man.mtool.work/python/3.14/library/asyncio-dev.html
A Conceptual Overview of asyncio 9334
A Conceptual Overview of asyncio この HOWTO では、 asyncio の基本的な仕組みをしっかり理解できるように説明します。 推奨される書き方がどのように動き、なぜ推奨されるのかを理解する助けになるでしょう。 asyncio の主要な概念について、疑問を持ってい ... y : 21 coroutine . send ( 42 ) 22 except StopIteration as e : 23 returned_value = e . value 24 print ( f "Coroutine main() finished and provided value: { returned_value } ." ) yield は通常どおり実行を中断し、呼び出し元に制御を戻します。 上の例では、11 行 ... and sending in value: 42. Rock.__await__ resuming with value: 42. Coroutine received value: 42 from rock. Coroutine main() finished and provided value: 23. ここで少し立ち止まり、制御や値がどのように受け渡されたかを追えているか確認してください。 重要な考え ...
https://man.mtool.work/python/3.14/howto/a-conceptual-overview-of-asyncio.html
コマンドラインのイントロスペクションツール 9334
コマンドラインのイントロスペクションツール ソースコード: Lib/asyncio/tools.py asyncio モジュールは python -m asyncio でスクリプトとして実行でき、実行中の別の Python プロセスを変更したり再起動したりせずに、そのタスクグラフを調べられます。 こ ... グラムを使います。 example.py import asyncio import os async def play ( track ): await asyncio . sleep ( 3600 ) print ( f "? Finished: { track } " ) async def album ( name , tracks ): async with asyncio . TaskGroup () as tg : for track in tracks : tg . cre ...
https://man.mtool.work/python/3.14/library/asyncio-tools.html
Logging クックブック 8917
Logging クックブック Author : Vinay Sajip <vinay_sajip at red-dove dot com> このページは、過去に有用であるとされていた、logging に関連するいくつものレシピを含んでいます。チュートリアルやリファレンス情報へのリンクについては その他のリソース ... dule.Auxiliary' ) logger . info ( 'calling auxiliary_module.Auxiliary.do_something' ) a . do_something () logger . info ( 'finished auxiliary_module.Auxiliary.do_something' ) logger . info ( 'calling auxiliary_module.some_function()' ) auxiliary_module . ... 9 - spam_application.auxiliary.Auxiliary - INFO - done doing something 2005-03-23 23:47:11,670 - spam_application - INFO - finished auxiliary_module.Auxiliary.do_something 2005-03-23 23:47:11,671 - spam_application - INFO - calling auxiliary_module.some_ ... m_requests += 1 logger . debug ( 'Request processing started' ) webapplib . useful () logger . debug ( 'Request processing finished' ) def main (): fn = os . path . splitext ( os . path . basename ( __file__ ))[ 0 ] adhf = argparse . ArgumentDefaultsHelp ...
https://man.mtool.work/python/3.14/howto/logging-cookbook.html
ast --- 抽象構文木 8098
ast --- 抽象構文木 ソースコード: Lib/ast.py ast モジュールは、Python の抽象構文を表す木を Python アプリケーションで処理するための機能を提供します。 抽象構文自体は Python のリリースごとに変わる可能性がありますが、このモジュールを使えば、現在 ... ードからなります。 これらのノードはどのような順序でもよく、交互に並ぶ必要はありません。 >>> expr = ast . parse ( 't" {name} finished {place:ordinal}"' , mode = 'eval' ) >>> print ( ast . dump ( expr , indent = 4 )) Expression( body=TemplateStr( values=[ I ... nterpolation( value=Name(id='name', ctx=Load()), str='name', conversion=-1), Constant(value=' finished '), Interpolation( value=Name(id='place', ctx=Load()), str='place', conversion=-1, format_spec=JoinedStr( values=[ Constan ...
https://man.mtool.work/python/3.14/library/ast.html
bz2 --- bzip2 圧縮のサポート 8098
bz2 --- bzip2 圧縮のサポート ソースコード: Lib/bz2.py このモジュールは、bzip2 アルゴリズムを用いて圧縮・展開を行う包括的なインターフェイスを提供します。 bz2 モジュールは次の機能を提供します。 圧縮ファイルを読み書きするための open() 関数と B ... r object ... out = out + comp . compress ( chunk ) ... >>> # Finish the compression process. Call this once you have >>> # finished providing data to the compressor. >>> out = out + comp . flush () 上の例は、非常に "ランダムでない" データストリーム (チャ ...
https://man.mtool.work/python/3.14/library/bz2.html
logging --- Python 用のログ記録手段 8098
logging --- Python 用のログ記録手段 ソースコード: Lib/logging/__init__.py Important このページには、リファレンス情報だけが含まれています。チュートリアルは、以下のページを参照してください 基本チュートリアル 上級チュートリアル ロギングクックブ ... g ( filename = 'myapp.log' , level = logging . INFO ) logger . info ( 'Started' ) mylib . do_something () logger . info ( 'Finished' ) if __name__ == '__main__' : main () # mylib.py import logging logger = logging . getLogger ( __name__ ) def do_somethin ... ' ) myapp.py を実行すれば、 myapp.log でログが確認できます: INFO:__main__:Started INFO:mylib:Doing something INFO:__main__:Finished この慣用的な使い方における重要な特色は、大部分のコードは getLogger(__name__) で単にモジュールレベルのロガーを作るだけで、そ ...
https://man.mtool.work/python/3.14/library/logging.html
queue --- 同期キュークラス 8098
queue --- 同期キュークラス ソースコード: Lib/queue.py queue モジュールは、複数の生産者と消費者が使えるキューを実装しています。 複数のスレッド間で安全に情報を交換する必要があるスレッドプログラミングで特に役立ちます。 このモジュールの Queue ク ... ort queue q = queue . Queue () def worker (): while True : item = q . get () print ( f 'Working on { item } ' ) print ( f 'Finished { item } ' ) q . task_done () # ワーカースレッドを起動する。 threading . Thread ( target = worker , daemon = True ) . star ...
https://man.mtool.work/python/3.14/library/queue.html
11. 標準ライブラリをひとめぐり --- その II 8098
11. 標準ライブラリをひとめぐり --- その II ツアーの第2部では、プロフェッショナルプログラミングを支えるもっと高度なモジュールをカバーします。ここで挙げるモジュールは、小さなスクリプトの開発ではほとんど使いません。 11.1. 出力のフォーマット re ... lf ): with zipfile . ZipFile ( self . outfile , 'w' , zipfile . ZIP_DEFLATED ) as f : f . write ( self . infile ) print ( 'Finished background zip of:' , self . infile ) background = AsyncZip ( 'mydata.txt' , 'myarchive.zip' ) background . start () print ...
https://man.mtool.work/python/3.14/tutorial/stdlib2.html
PREV 1 2 NEXT