Results of 1 - 10 of about 71 for threading (0.010 sec.)
- threading --- スレッドベースの並列処理 14098
- threading --- スレッドベースの並列処理 ソースコード: Lib/threading.py このモジュールでは、高水準のスレッドインターフェースをより低水準 な _thread モジュールの上に構築しています。 利用可能な環境 : not WASI. このモジュールは WebAssembly では動
...作しないか、利用不可です。詳しくは、 WebAssembly プラットフォーム を見てください。 はじめに threading モジュールを使うと、1 つのプロセス内で複数の スレッド (プロセスより小さな実行単位) を並行して実行できます。 スレッドの作成...は、ファイル操作やネットワークリクエストなど、外部リソースを待つ時間が大部分を占める I/O バウンドのタスクで特に役立ちます。 threading の典型的な用途には、複数のタスクを並行して処理するワーカースレッドのプールの管理があります。 以下は Thread を使ってスレッド...を作成し、開始する基本的な例です。 import threading import time def crawl ( link , delay = 3 ): print ( f "crawl started for { link } " ) time . sleep ( delay ) # ブロックする... - https://man.mtool.work/python/3.14/library/threading.html
- 将来のバージョンで削除予定 12425
- 将来のバージョンで削除予定 以下の API は将来削除されますが、現時点では削除時期は決まっていません。 argparse : 引数グループの入れ子と、相互排他的なグループの入れ子は非推奨です。 add_argument_group() に、ドキュメント化されていないキーワード引
....PROTOCOL_TLSv1 ssl.PROTOCOL_TLSv1_1 ssl.PROTOCOL_TLSv1_2 ssl.TLSVersion.SSLv3 ssl.TLSVersion.TLSv1 ssl.TLSVersion.TLSv1_1 threading のメソッド: threading.Condition.notifyAll() : notify_all() を使ってください。 threading.Event.isSet() : is_set() を使ってく...ださい。 threading.Thread.isDaemon() 、 threading.Thread.setDaemon() : threading.Thread.daemon 属性を使ってください。 threading.Thread.getNam...e() 、 threading.Thread.setName() : threading.Thread.name 属性を使ってください。 threading.currentThread() : threading.current_thread() を使... - https://man.mtool.work/python/3.14/deprecations/pending-removal-in-future.html
- multiprocessing --- プロセスベースの並列処理 10570
- multiprocessing --- プロセスベースの並列処理 ソースコード: Lib/multiprocessing/ 利用可能な環境 : not Android, not iOS, not WASI. このモジュールは モバイルプラットフォーム と WebAssemblyプラットフォーム をサポートしません。 はじめに multipro
...cessing は、 threading モジュールに似た API でプロセスを生成できるパッケージです。 multiprocessing パッケージは、ローカルとリモートの両方で並行処...に以下が出力されます: [ 1 , 4 , 9 ] multiprocessing モジュールには、実行中のプロセスの terminate 、 interrupt 、 kill など、 threading モジュールには対応するものがない API もあります。 参考 concurrent.futures.ProcessPoolExecutor は、呼び出し元プロセスの実行...multiprocessing では、 Process オブジェクトを作成して start() メソッドを呼び出すことで、プロセスを生成します。 Process は threading.Thread の API に従っています。 以下は、複数のプロセスを使うプログラムの簡単な例です。 from multiprocessing import Process... - https://man.mtool.work/python/3.14/library/multiprocessing.html
- 非推奨 9684
- 非推奨 Python 3.15 で削除予定 インポートシステム: Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take into consideration by the import system or standard
...argely untested. sysconfig : The check_home argument of sysconfig.is_python_build() has been deprecated since Python 3.12. threading : RLock() will take no arguments in Python 3.15. Passing any arguments has been deprecated since Python 3.14, as the Pytho....PROTOCOL_TLSv1 ssl.PROTOCOL_TLSv1_1 ssl.PROTOCOL_TLSv1_2 ssl.TLSVersion.SSLv3 ssl.TLSVersion.TLSv1 ssl.TLSVersion.TLSv1_1 threading のメソッド: threading.Condition.notifyAll() : notify_all() を使ってください。 threading.Event.isSet() : is_set() を使ってく...ださい。 threading.Thread.isDaemon() 、 threading.Thread.setDaemon() : threading.Thread.daemon 属性を使ってください。 threading.Thread.getNam... - https://man.mtool.work/python/3.14/deprecations/
- What's New In Python 3.10 9150
- What's New In Python 3.10 編集者 : Pablo Galindo Salgado この記事では Python 3.9 と比較した Python 3.10 の新機能を解説します。Python 3.10 は2021年10月4日にリリースされました。全詳細については 変更履歴 をご覧ください。 概要 -- リリースハイラ
...ションで指定できるようになりました。 デフォルトは従来どおり signal.SIGINT です。 (Antoine Pitrou による貢献、 bpo-43356 。) threading threading.settrace() と threading.setprofile() で設定した関数をそれぞれ取得する、 threading.gettrace() と threading.getpro...file() を追加しました。 (Mario Corchero による貢献、 bpo-42251 。) threading.excepthook() が動作しない値や別の値に設定された場合に元の値を取得できるよう、 threading.__excepthook__ を追加しました。 (M...クエリパラメータを指定し、URI モードでデータベースを開いてください。 (Erlend E. Aasland による貢献、 bpo-24464 。) 以下の threading メソッドは非推奨になりました: threading.currentThread => threading.current_thread() threading.activeCount => threading.act... - https://man.mtool.work/python/3.14/whatsnew/3.10.html
- test --- Python の回帰テストパッケージ 8883
- test --- Python の回帰テストパッケージ 注釈 test パッケージは Python 内部での使用のみを目的としています。 このドキュメントは Python のコア開発者向けに用意されています。 ここで説明するコードは Python のリリース間で予告なく変更または削除される
...tNotInBytecode ( x , opname , argval = _UNSPECIFIED ) opname が見つかった場合は AssertionError を送出します。 test.support.threading_helper --- スレッドのテスト用ユーティリティ test.support.threading_helper モジュールはスレッドのテストを支援する機能を提供...します。 Added in version 3.10. test.support.threading_helper. join_thread ( thread , timeout = None ) thread を timeout 以内に join します。 timeout 秒後もスレッドが生存している...場合は、 AssertionError を送出します。 @ test.support.threading_helper. reap_threads テストが失敗してもスレッドが確実に後始末されるようにするデコレータです。 test.support.threading_helpe... - https://man.mtool.work/python/3.14/library/test.html
- asyncio とフリースレッド Python 8532
- asyncio とフリースレッド Python asyncio uses an event loop as a scheduler to enable highly efficient concurrency by switching between tasks to allow non-blocking I/O operations. This results in better performance for I/O-bound use cases. It
...asyncio.Event など) は、スレッドをまたいで使うようには設計されていません。 スレッド間で同期する必要がある場合は、代わりに threading モジュールの同期プリミティブを使ってください。 asyncio とスレッドの併用 asyncio はスレッドごとに 1 つのイベントループを実行...、それぞれのループに独立してタスクをスケジュールできます。 asyncio とスレッドを併用する例を示します。 import asyncio import threading async def worker ( name : str ) -> None : print ( f "Worker { name } starting" ) await asyncio . sleep ( 1 ) print ( f "Wo...rker { name } done" ) def run_loop ( name : str ) -> None : asyncio . run ( worker ( name )) threads = [ threading . Thread ( target = run_loop , args = ( f "T { i } " ,)) for i in range ( 4 ) ] for t in threads : t . start () for t in t... - https://man.mtool.work/python/3.14/library/asyncio-threading.html
- What's New In Python 3.12 8532
- What's New In Python 3.12 編集者 : Adam Turner この記事では Python 3.11 と比較した Python 3.12 の新機能を解説します。Python 3.12 は2023年10月2日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP 693 -- Python 3.12 リリ
...h-58451 で貢献しました。) tempfile.mkdtemp() は、 dir 引数に相対パスを渡した場合でも、常に絶対パスを返すようになりました。 threading 呼び出し元だけでなく、実行中のすべてのスレッドにトレース関数やプロファイル関数を設定する threading.settrace_all_threads()...と threading.setprofile_all_threads() を追加しました。 (Pablo Galindo が gh-93503 で貢献しました。) tkinter tkinter.Canvas.coords() が引...N 件表示するコマンドラインオプション --durations を追加しました。 python3 - m unittest -- durations = 3 lib . tests . test_threading ..... Slowest test durations ---------------------------------------------------------------------- 1.210 s test_timeout (... - https://man.mtool.work/python/3.14/whatsnew/3.12.html
- ライブラリと拡張 FAQ 8180
- ライブラリと拡張 FAQ ライブラリ一般の質問 作業 X を行うためのモジュールやアプリケーションを探すにはどうしますか? ライブラリリファンレス から関係がありそうな標準ライブラリモジュールがあるかどうか調べてください。 (標準ライブラリに何があるかが
...は少し大き過ぎるモジュールです。 スレッド スレッドを使ったプログラムを書くにはどうしますか? _thread モジュールではなく、必ず threading モジュールを使ってください。 threading モジュールは、 _thread モジュールで提供される低レベルな基本要素の、便利な抽象化を構...も与えられません。 簡単な解決策は、プログラムの終わりに、スレッドが完了するのに十分な時間のスリープを加えることです: import threading , time def thread_task ( name , n ): for i in range ( n ): print ( name , i ) for i in range ( 10 ): T = threading . Threa..., n ): time . sleep ( 0.001 ) # <--------------------! for i in range ( n ): print ( name , i ) for i in range ( 10 ): T = threading . Thread ( target = thread_task , args = ( str ( i ), i )) T . start () time . sleep ( 10 ) time.sleep() の良い遅延時間を推... - https://man.mtool.work/python/3.14/faq/library.html
- What's new in Python 3.14 8180
- What's new in Python 3.14 エディタ : Adam Turner と Hugo van Kemenade この記事では Python 3.13 と比較した Python 3.14 の新機能を解説します。Python 3.14 は2025年10月7日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP
...単純な並行実行でない限り、人間にとって実装や保守が難しいことが多いです。特に、OSレベルのスレッドを直接使用する場合は (例えば threading )、メモリがすべてのスレッド間で共有されるため、複雑になります。 互いに独立した複数インタープリタを使用することで、 Communi...有効なビルドでは偽です。 A new thread_inherit_context flag has been added, which if enabled means that threads created with threading.Thread start with a copy of the Context() of the caller of start() . Most significantly, this makes the warning filtering...() は拒否されたメンバーを展開しなくなりました。 (Matt Prodani と Petr Viktorin による貢献。 gh-112887 と CVE 2025-4435 。) threading threading.Thread.start() は、OS 上のスレッド名を threading.Thread.name に設定するようになりました。 (Victor Stinner が gh-... - https://man.mtool.work/python/3.14/whatsnew/3.14.html