Results of 1 - 10 of about 14 for initialization (0.026 sec.)
- 拡張モジュールの定義 14844
- 拡張モジュールの定義 A C extension for CPython is a shared library (for example, a .so file on Linux, .pyd DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which
...exports an initialization function . デフォルトで (つまり、 importlib.machinery.ExtensionFileLoader によって) インポート可能であるためには、共有ライ...ルの一つは Setuptools であり、ドキュメントは https://setuptools.pypa.io/en/latest/setuptools.html にあります。 Normally, the initialization function returns a module definition initialized using PyModuleDef_Init() . This allows splitting the creation process int...object is initialized using extension-specific code -- the equivalent of __init__() on classes. This is called multi-phase initialization to distinguish it from the legacy (but still supported) single-phase initialization scheme, where the initialization funct... - https://man.mtool.work/python/3.14/c-api/extension-modules.html
- モジュールオブジェクト (module object) 9382
- モジュールオブジェクト (module object) PyTypeObject PyModule_Type 次に属します: Stable ABI . この PyTypeObject のインスタンスは Python のモジュール型を表します。 Python プログラムには types.ModuleType として公開されています。 int PyModule_C
...not support sub-interpreters, because it has global state. Negative m_size is only allowed when using legacy single-phase initialization or when creating modules dynamically . 詳細は PEP 3121 を参照。 PyMethodDef * m_methods A pointer to a table of module-lev...f values. Can be NULL if no functions are present. PyModuleDef_Slot * m_slots An array of slot definitions for multi-phase initialization, terminated by a {0, NULL} entry. When using legacy single-phase initialization, m_slots must be NULL . バージョン 3.5 で変...version 3.13. 拡張モジュールの動的な作成 The following functions may be used to create a module outside of an extension's initialization function . They are also used in single-phase initialization . PyObject * PyModule_Create ( PyModuleDef * def ) 戻り値: 新... - https://man.mtool.work/python/3.14/c-api/module.html
- Python インタプリタの拡張と埋め込み 8840
- Python インタプリタの拡張と埋め込み This document describes how to write modules in C or C++ to extend the Python interpreter with new modules. Those modules can not only define new functions but also new object types and their methods. The
...するおすすめの方法というよりも、主にそれらのツールを作成する人向けのものです。 参考 PEP 489 -- Multi-phase extension module initialization 1. Extending Python with C or C++ 1.1. A Simple Example 1.2. Intermezzo: Errors and Exceptions 1.3. Back to the Example 1....4. The Module's Method Table and Initialization Function 1.5. Compilation and Linkage 1.6. C から Python 関数を呼び出す 1.7. 拡張モジュール関数でのパラメタ展開 1.8. 拡張モ... - https://man.mtool.work/python/3.14/extending/
- 1. Extending Python with C or C++ 8752
- 1. Extending Python with C or C++ It is quite easy to add new built-in modules to Python, if you know how to program in C. Such extension modules can do two things that can't be done directly in Python: they can implement new built-in objec
...ject rather than a NULL pointer, which means "error" in most contexts, as we have seen. 1.4. The Module's Method Table and Initialization Function I promised to show how spam_system() is called from Python programs. First, we need to list its name and address...ule = { ... . m_methods = spam_methods , ... }; This structure, in turn, must be passed to the interpreter in the module's initialization function. The initialization function must be named PyInit_name() , where name is the name of the module, and should be th...pam() function is not called automatically unless there's an entry in the PyImport_Inittab table. To add the module to the initialization table, use PyImport_AppendInittab() , optionally followed by an import of the module: #define PY_SSIZE_T_CLEAN #include <P... - https://man.mtool.work/python/3.14/extending/extending.html
- Python 初期化設定 8472
- Python 初期化設定 PyInitConfig C API Added in version 3.14. Python は Py_InitializeFromInitConfig() で初期化できます。 Py_RunMain() 関数は、カスタマイズされた Python プログラムを書くために使用できます。 Initialization, Finalization, and Thr
...せず、シグナルハンドラーを登録しません。 Py_RunMain() 関数は、カスタマイズされた Python プログラムを書くために使用できます。 Initialization, Finalization, and Threads も参照してください。 参考 PEP 587 "Python 初期化設定" 使用例 常に隔離モードで実行するようカスタ...on ( status )) { goto done ; } /* Specify sys.path explicitly */ /* If you want to modify the default set of paths, finish initialization first and then use PySys_GetObject("path") */ config . module_search_paths_set = 1 ; status = PyWideStringList_Append ( &...も参照してください。 Delaying main module execution In some embedding use cases, it may be desirable to separate interpreter initialization from the execution of the main module. This separation can be achieved by setting PyConfig.run_command to the empty string... - https://man.mtool.work/python/3.14/c-api/init_config.html
- インタープリタの初期化と終了処理 8297
- インタープリタの初期化と終了処理 初期化前にインタープリタを設定する方法の詳細は、 Python の初期化設定 を参照してください。 Python の初期化前 Python を組み込むアプリケーションでは、一部の関数と グローバルな設定変数 を除き、ほかの Python/C AP
...ns , __main__ and sys . It also initializes the module search path ( sys.path ). It does not set sys.argv ; use the Python Initialization Configuration API for that. This is a no-op when called for a second time (without calling Py_FinalizeEx() first). There i...s no return value; it is a fatal error if the initialization fails. Python の初期化設定 をカスタマイズするには、 Py_InitializeFromConfig() を使ってください。 注釈 Windows では O_TEXT...ference count. Some memory allocated by extension modules may not be freed. Some extensions may not work properly if their initialization routine is called more than once; this can happen if an application calls Py_Initialize() and Py_FinalizeEx() more than on... - https://man.mtool.work/python/3.14/c-api/interp-lifecycle.html
- Python/C API リファレンスマニュアル 8209
- Python/C API リファレンスマニュアル このマニュアルでは、拡張モジュールを書いたり Python インタプリタをアプリケーションに埋め込んだりしたい C/C++ プログラマが利用できる API について述べています。 Python インタプリタの拡張と埋め込み は拡張モジ
...ジェクト Unicode 例外オブジェクト 再帰の管理 例外と警告の型 トレースバック 拡張モジュールの定義 複数のモジュールインスタンス Initialization function 多段階初期化 従来の一段階初期化 ユーティリティ オペレーティングシステム関連のユーティリティ システム関数 プロセス... - https://man.mtool.work/python/3.14/c-api/
- C API 拡張のフリースレッド対応 8209
- C API 拡張のフリースレッド対応 CPython 3.13 から、 global interpreter lock (GIL) を無効にして実行する free threading という構成がサポートされています。 このドキュメントでは、C API を使う拡張をフリースレッドに対応させる方法を説明します。 C か
...ーズ初期化と単一フェーズ初期化のどちらを使うかによって、2 通りあります。 複数フェーズ初期化 Extensions that use multi-phase initialization (i.e., PyModuleDef_Init() ) should add a Py_mod_gil slot in the module definition. If your extension supports older versio...oduledef = { PyModuleDef_HEAD_INIT , . m_slots = module_slots , ... }; 単一フェーズ初期化 Extensions that use single-phase initialization (i.e., PyModule_Create() ) should call PyUnstable_Module_SetGIL() to indicate that they support running with the GIL disab... - https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
- はじめに 8034
- はじめに Python のアプリケーションプログラマー向けインターフェース (API) は、C と C++ のプログラマーに、Python インタープリタへのさまざまなレベルのアクセスを提供します。 C++ からも同様に使えますが、簡潔に Python/C API と呼びます。 Python/C
...込みを行う人 (いわば拡張モジュールの書き手の対極) が気にかけなければならない重要なタスクは、Python インタプリタの初期化処理 (initialization)、そしておそらくは終了処理 (finalization) です。インタプリタのほとんどの機能は、インタプリタの起動後しか使えません。 基本的...s needed by Python code that will be executed later, setting PyConfig.argv and PyConfig.parse_argv must be set: see Python Initialization Configuration . ほとんどのシステムでは (特に Unix と Windows は、詳細がわずかに異なりはしますが)、 Py_Initialize() は標準の... - https://man.mtool.work/python/3.14/c-api/intro.html
- site --- サイト固有の設定フック 8034
- site --- サイト固有の設定フック ソースコード: Lib/site.py このモジュールは初期化中に自動的にインポートされます。 自動インポートはインタプリタの -S オプションで禁止できます。 Importing this module normally appends site-specific paths to the
...ecutable lines is to make the corresponding module(s) importable (load 3rd-party import hooks, adjust PATH etc). Any other initialization is supposed to be done upon a module's actual import, if and when it happens. Limiting a code chunk to a single line is a... - https://man.mtool.work/python/3.14/library/site.html