per page, with , order by , clip by
Results of 1 - 10 of about 21 for Initialize (0.004 sec.)
インタープリタの初期化と終了処理 15678
インタープリタの初期化と終了処理 初期化前にインタープリタを設定する方法の詳細は、 Python の初期化設定 を参照してください。 Python の初期化前 Python を組み込むアプリケーションでは、一部の関数と グローバルな設定変数 を除き、ほかの Python/C AP ... I を使う前に Py_Initialize() を呼び出さなければなりません。 次の関数は Python の初期化の前でも安全に呼び出せます: インタープリタを初期化する関数: Py_ ... Initialize() Py_InitializeEx() Py_InitializeFromConfig() Py_BytesMain() Py_Main() Python 初期化設定 で説明するランタイムの事前初期化関数 設定関数: Py ... bject_SetArenaAllocator() Py_SetProgramName() Py_SetPythonHome() Python 初期化設定 で説明する設定関数 情報取得の関数: Py_IsInitialized() PyMem_GetAllocator() PyObject_GetArenaAllocator() Py_GetBuildInfo() Py_GetCompiler() Py_GetCopyright() Py_GetPlatform() ...
https://man.mtool.work/python/3.14/c-api/interp-lifecycle.html
1. 他のアプリケーションへの Python の埋め込み 9792
1. 他のアプリケーションへの Python の埋め込み 前章では、 Python を拡張する方法、すなわち C 関数のライブラリを Python に結びつけて機能を拡張する方法について述べました。同じようなことを別の方法でも実行できます: それは、自分の C/C++ アプリケー ... せん。メインプログラムがやらなければならないことの一つに、 Python インタプリタの初期化があります。とにかく少なくとも関数 Py_Initialize() を呼び出さねばなりません。オプションとして、Python 側にコマンドライン引数を渡すために関数呼び出しを行います。その後、アプ ... g ( & config , & config . program_name , argv [ 0 ]); if ( PyStatus_Exception ( status )) { goto exception ; } status = Py_InitializeFromConfig ( & config ); if ( PyStatus_Exception ( status )) { goto exception ; } PyConfig_Clear ( & config ); PyRun_Simple ... 維持されています。このマクロの説明は 文字列とバッファ にあります。 Setting PyConfig.program_name should be called before Py_InitializeFromConfig() to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is initialize ...
https://man.mtool.work/python/3.14/extending/embedding.html
Python プロセス内の複数のインタープリタ 8710
Python プロセス内の複数のインタープリタ ほとんどの場合は埋め込む Python インタプリタは1つだけですが、いくつかの場合に同一プロセス内、あるいは同一スレッド内で、複数の独立したインタプリタを作成する必要があります。 これを可能にするのがサブイン ... ープリタ間で共有され、望ましくない動作を引き起こす可能性があります (以下の Bugs and caveats を参照)。 Py_FinalizeEx() と Py_Initialize() を呼び出してインタープリタを完全に再初期化した後で、拡張をインポートする場合とは異なります。 その場合は、拡張の initmodu ... 523 「Adding a frame evaluation API to CPython」を参照してください。 Added in version 3.9. 低水準 API 次の全ての関数は Py_Initialize() の後に呼び出さなければなりません。 バージョン 3.7 で変更: Py_Initialize() が GIL を初期化し、 スレッド状態をアタッチ する ...
https://man.mtool.work/python/3.14/c-api/subinterpreters.html
はじめに 8558
はじめに Python のアプリケーションプログラマー向けインターフェース (API) は、C と C++ のプログラマーに、Python インタープリタへのさまざまなレベルのアクセスを提供します。 C++ からも同様に使えますが、簡潔に Python/C API と呼びます。 Python/C ... finalization) です。インタプリタのほとんどの機能は、インタプリタの起動後しか使えません。 基本的な初期化処理を行う関数は Py_Initialize() です。この関数はロード済みのモジュールからなるテーブルを作成し、土台となるモジュール builtins , __main__ , および sys を ... 作成します。また、モジュール検索パス ( sys.path ) の初期化も行います。 Py_Initialize() does not set the "script argument list" ( sys.argv ). If this variable is needed by Python code that will be executed la ... ython Initialization Configuration . ほとんどのシステムでは (特に Unix と Windows は、詳細がわずかに異なりはしますが)、 Py_Initialize() は標準の Python インタプリタ実行形式の場所に対する推定結果に基づいて、 Python のライブラリが Python インタプリタ実行形式 ...
https://man.mtool.work/python/3.14/c-api/intro.html
モジュールのインポート 8422
モジュールのインポート PyObject * PyImport_ImportModule ( const char * name ) 戻り値: 新しい参照。 次に属します: Stable ABI . PyImport_Import() のラッパーで、引数として PyObject * の代わりに const char * を受け取ります。 PyObject * PyImport ... ます。新たなモジュールは name でインポートでき、最初にインポートを試みた際に呼び出される関数として initfunc を使います。 Py_Initialize() よりも前に呼び出さなければなりません。 struct _inittab 組み込みモジュールの一覧の一つのエントリーを記述する構造体です。 ... るためのメモリを十分に割り当てられなければ -1 を返します。 失敗した場合、内部テーブルにモジュールは一つも追加されません。 Py_Initialize() より前に呼び出す必要があります。 Python が複数回初期化される場合、 PyImport_AppendInittab() または PyImport_ExtendInitta ...
https://man.mtool.work/python/3.14/c-api/import.html
オペレーティングシステム関連のユーティリティ 8287
オペレーティングシステム関連のユーティリティ PyObject * PyOS_FSPath ( PyObject * path ) 戻り値: 新しい参照。 次に属します: Stable ABI (バージョン 3.6 より). path のファイルシステム表現を返します。 オブジェクトが str または bytes の場合は、新 ... 証されます。 LC_CTYPE ロケールを適切に設定するため、 Python が事前初期化される 前にこの関数を呼び出してはいけません。 Py_PreInitialize() 関数を参照してください。 ファイルシステムのエンコーディングとエラーハンドラ からバイト文字列をデコードします。エラーハン ... ださい。 警告 LC_CTYPE ロケールを適切に設定するため、 Python が事前初期化される 前にこの関数を呼び出してはいけません。 Py_PreInitialize() 関数を参照してください。 参考 PyUnicode_EncodeFSDefault() および PyUnicode_EncodeLocale() 関数。 Added in version 3.5. バ ... WarnOptions ( ) 次に属します: Stable ABI . Reset sys.warnoptions to an empty list. This function may be called prior to Py_Initialize() . バージョン 3.13 で非推奨、バージョン 3.15 で削除予定: Clear sys.warnoptions and warnings.filters instead. void PySys_W ...
https://man.mtool.work/python/3.14/c-api/sys.html
拡張モジュールの定義 8152
拡張モジュールの定義 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 ... etuptools.pypa.io/en/latest/setuptools.html にあります。 Normally, the initialization function returns a module definition initialized using PyModuleDef_Init() . This allows splitting the creation process into several phases: Before any substantial code is ... .__new__() for classes. It also sets initial attributes like __package__ and __loader__ . Afterwards, the module object is initialized using extension-specific code -- the equivalent of __init__() on classes. This is called multi-phase initialization to di ... is mirrors the behavior of pure-Python modules. サブインタープリタ 内や、Python ランタイムの再初期化 ( Py_Finalize() と Py_Initialize() ) 後にも、追加のモジュールインスタンスが作成される可能性があります。 これらの場合、モジュールインスタンス間で Python オブ ...
https://man.mtool.work/python/3.14/c-api/extension-modules.html
ファイルオブジェクト 8152
ファイルオブジェクト これらの API は、C 標準ライブラリのバッファ付き I/O ( FILE * ) に依存していた Python 2 の組み込みファイルオブジェクトの C API を、最小限エミュレートするものです。 Python 3 のファイルやストリームは新しい io モジュールを使 ... deHook() の呼び出しは失敗します。 失敗すると -1 を返し、インタープリタが初期化済みの場合は例外も設定します。 この関数は Py_Initialize() より前に呼び出しても安全です。 引数無しで 監査イベント setopencodehook を送出します。 Added in version 3.8. PyObject * P ...
https://man.mtool.work/python/3.14/c-api/file.html
モジュールオブジェクト (module object) 8152
モジュールオブジェクト (module object) PyTypeObject PyModule_Type 次に属します: Stable ABI . この PyTypeObject のインスタンスは Python のモジュール型を表します。 Python プログラムには types.ModuleType として公開されています。 int PyModule_C ... from it exist). Usually, there is only one variable of this type for each extension module. PyModuleDef_Base m_base Always initialize this member to PyModuleDef_HEAD_INIT . const char * m_name Name for the new module. const char * m_doc Docstring for the m ... after the m_free function has been called, if present. Setting it to a non-negative value means that the module can be re-initialized and specifies the additional amount of memory it requires for its state. Setting m_size to -1 means that the module does ... ジョンの判別には役立ちません。 将来は変更される可能性があります。 サポート関数 The following functions are provided to help initialize a module state. They are intended for a module's execution slots ( Py_mod_exec ), the initialization function for legacy s ...
https://man.mtool.work/python/3.14/c-api/module.html
1. Extending Python with C or C++ 8152
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 ... ; static int spam_module_exec ( PyObject * m ) { if ( SpamError != NULL ) { PyErr_SetString ( PyExc_ImportError , "cannot initialize spam module more than once" ); return -1 ; } SpamError = PyErr_NewException ( "spam.error" , NULL , NULL ); if ( PyModule_ ... argv []) { PyStatus status ; PyConfig config ; PyConfig_InitPythonConfig ( & config ); /* Add a built-in module, before Py_Initialize */ if ( PyImport_AppendInittab ( "spam" , PyInit_spam ) == -1 ) { fprintf ( stderr , "Error: could not extend in-built mod ... ytesString ( & config , & config . program_name , argv [ 0 ]); if ( PyStatus_Exception ( status )) { goto exception ; } /* Initialize the Python interpreter. Required. If this step fails, it will be a fatal error. */ status = Py_InitializeFromConfig ( & co ...
https://man.mtool.work/python/3.14/extending/extending.html
PREV 1 2 3 NEXT