Results of 1 - 10 of about 26 for existing (0.008 sec.)
- dbm --- Unix "データベース" へのインターフェース 15373
- dbm --- Unix "データベース" へのインターフェース ソースコード: Lib/dbm/__init__.py dbm は DBM データベースの各種実装に対する汎用インターフェースです: dbm.sqlite3 dbm.gnu dbm.ndbm If none of these modules are installed, the slow-but-simple i
...在しない場合は、上に挙げたサブモジュールのうち最初にインポートできたものを使います。 flag ( str ) -- 'r' (デフォルト): Open existing database for reading only. 'w' : Open existing database for reading and writing. 'c' : Open database for reading and writi...スを開きます。 パラメータ : filename ( path-like object ) -- 開くデータベースのパス。 flag ( str ) -- 'r' (デフォルト): Open existing database for reading only. 'w' : Open existing database for reading and writing. 'c' : Open database for reading and writi...を返します。 パラメータ : filename ( path-like object ) -- 開くデータベースファイル。 flag ( str ) -- 'r' (デフォルト): Open existing database for reading only. 'w' : Open existing database for reading and writing. 'c' : Open database for reading and writi... - https://man.mtool.work/python/3.14/library/dbm.html
- multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ 10282
- multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ ソースコード Lib/multiprocessing/shared_memory.py Added in version 3.8. このモジュールは、マルチコアもしくは対称型マルチプロセッサ(SMP) を持つマシン上で実行される、ひ
...hon シェルで >>> import numpy as np >>> from multiprocessing import shared_memory >>> # 既存の共有メモリブロックに接続 >>> existing_shm = shared_memory . SharedMemory ( name = 'psm_21467_46075' ) >>> # この例では a.shape は (6,)、a.dtype は np.int64 >>>...c = np . ndarray (( 6 ,), dtype = np . int64 , buffer = existing_shm . buf ) >>> c array([1, 1, 2, 3, 5, 8]) >>> c [ - 1 ] = 888 >>> c array([ 1, 1, 2, 3, 5, 888]) >>> # 最初の Python 対話...y([ 1, 1, 2, 3, 5, 888]) >>> # 2 番目の Python シェルで後始末 >>> del c # 必須ではないが、配列をもう使わないことを示す >>> existing_shm . close () >>> # 最初の Python シェルで後始末 >>> del b # 必須ではないが、配列をもう使わないことを示す >>> shm . close... - https://man.mtool.work/python/3.14/library/multiprocessing.shared_memory.html
- Logging クックブック 10017
- Logging クックブック Author : Vinay Sajip <vinay_sajip at red-dove dot com> このページは、過去に有用であるとされていた、logging に関連するいくつものレシピを含んでいます。チュートリアルやリファレンス情報へのリンクについては その他のリソース
...メッセージをファイル app.log に送る logging モジュールを下記の JSON によって構成したとしましょう: { "version" : 1 , "disable_existing_loggers" : false , "formatters" : { "simple" : { "format" : "%(levelname)-8s - %(message)s" } }, "handlers" : { "stdout" :...り、これで実行できる状態になりました: import json import logging import logging.config CONFIG = ''' { "version": 1, "disable_existing_loggers": false, "formatters": { "simple": { "format": " %(levelname)-8s - %(message)s " } }, "filters": { "warnings_and_b...のドキュメント から持ってきました。この辞書を dictConfig() に渡して設定を有効にします: LOGGING = { 'version' : 1 , 'disable_existing_loggers' : False , 'formatters' : { 'verbose' : { 'format' : ' {levelname} {asctime} {module} {process:d} {thread:d} {mess... - https://man.mtool.work/python/3.14/howto/logging-cookbook.html
- logging.config --- ログ記録の環境設定 9009
- logging.config --- ログ記録の環境設定 ソースコード: Lib/logging/config.py Important このページには、リファレンス情報だけが含まれています。チュートリアルは、以下のページを参照してください 基本チュートリアル 上級チュートリアル ロギングクックブ
...じように dictConfig() を呼び出せます。 Added in version 3.2. logging.config. fileConfig ( fname , defaults = None , disable_existing_loggers = True , encoding = None ) ログ記録の環境設定を configparser 形式ファイルから読み出します。そのファイルの形式は 環...場合はファイル名とみなして read() に渡します。 defaults -- ConfigParser に渡すデフォルト値をこの引数で指定できます。 disable_existing_loggers -- False が指定された場合は、この呼び出しが行われたときに存在するロガーは有効のまま残されます。後方互換性のあるやり...にはJSONフォーマットを使用する必要があります。これは、設定に dictConfig() を使用します。 このメソッドを使用すると、 disable_existing_loggers に False を指定した設定を送信できます。 logging.config. stopListening ( ) listen() を呼び出して作成された、待ち受け... - https://man.mtool.work/python/3.14/library/logging.config.html
- 拡張 8744
- 拡張 asyncio を拡張する主な方法は、独自の イベントループ クラスを書くことです。 asyncio には、この作業を簡単にするための補助機能があります。 注釈 Third-parties should reuse existing asyncio code with caution, a new Python version is free to
... - https://man.mtool.work/python/3.14/library/asyncio-extending.html
- subprocess --- サブプロセス管理 8744
- subprocess --- サブプロセス管理 ソースコード: Lib/subprocess.py subprocess モジュールでは、新しいプロセスを生成し、その標準入力、標準出力、標準エラー出力のパイプに接続して、終了コードを取得できます。 このモジュールは、次のような古いモジュー
...standard input, standard output and standard error file handles, respectively. Valid values are None , PIPE , DEVNULL , an existing file descriptor (a positive integer), and an existing file object with a valid file descriptor. With the default settings...standard input, standard output and standard error file handles, respectively. Valid values are None , PIPE , DEVNULL , an existing file descriptor (a positive integer), and an existing file object with a valid file descriptor. With the default settings... - https://man.mtool.work/python/3.14/library/subprocess.html
- unittest.mock --- モックオブジェクトライブラリ 8744
- unittest.mock --- モックオブジェクトライブラリ Added in version 3.3. ソースコード: Lib/unittest/mock.py unittest.mock は Python でテストを行うためのライブラリです。 テスト対象のシステムの一部をモックオブジェクトに置き換え、どのように使われた
...(またはクラスに存在しないメソッドや属性) にパッチを適用しようとすると AttributeError で失敗します。 >>> @patch ( 'sys.non_existing_attribute' , 42 ) ... def test (): ... assert sys . non_existing_attribute == 42 ... >>> test () Traceback (most recent ca...ll last): ... AttributeError : <module 'sys' (built-in)> does not have the attribute 'non_existing_attribute' ただし、 patch() の呼び出しに create=True を追加すると、上の例は期待どおりに動作します。 >>> @patch ( 'sys.non_...existing_attribute' , 42 , create = True ) ... def test ( mock_stdout ): ... assert sys . non_existing_attribute == 42 ... >>> test () バージョン 3.8 で変更: 対象が非同期関数の場合、 patch() は AsyncMock を返すようになりました... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- The Python Profilers 8497
- The Python Profilers Source code: Lib/profile.py and Lib/pstats.py Introduction to the profilers cProfile and profile provide deterministic profiling of Python programs. A profile is a set of statistics that describes how often and for how
...t "don't want to read the manual." It provides a very brief overview, and allows a user to rapidly perform profiling on an existing application. To profile a function that takes a single argument, you can do: import cProfile import re cProfile . run ( 'r...ll view of several processes can be considered in a single report. If additional files need to be combined with data in an existing Stats object, the add() method can be used. Instead of reading the profile data from a file, a cProfile.Profile or profile... - https://man.mtool.work/python/3.14/library/profile.html
- 弱参照オブジェクト 8232
- 弱参照オブジェクト Python は 弱参照 を第一級オブジェクト (first-class object) としてサポートします。弱参照を直接実装する二種類の固有のオブジェクト型があります。第一は単純な参照オブジェクトで、第二はオリジナルのオブジェクトに対して可能な限り
...proxy object for the object ob . This will always return a new reference, but is not guaranteed to create a new object; an existing proxy object may be returned. The second parameter, callback , can be a callable object that receives notification when ob... - https://man.mtool.work/python/3.14/c-api/weakref.html
- site --- サイト固有の設定フック 7984
- site --- サイト固有の設定フック ソースコード: Lib/site.py このモジュールは初期化中に自動的にインポートされます。 自動インポートはインタプリタの -S オプションで禁止できます。 Importing this module normally appends site-specific paths to the
...ne of the four directories mentioned above; its contents are additional items (one per line) to be added to sys.path . Non-existing items are never added to sys.path , and no check is made that the item refers to a directory rather than a file. No item i... - https://man.mtool.work/python/3.14/library/site.html