per page, with , order by , clip by
Results of 1 - 7 of about 7 for PyInit (0.014 sec.)
拡張モジュールの定義 13286
拡張モジュールの定義 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 ... Initialization function The initialization function defined by an extension module has the following signature: PyObject * PyInit_modulename ( void ) Its name should be PyInit_ <name> , with <name> replaced by the name of the module. For modules with A ... SCII-only names, the function must instead be named PyInit_ <name> , with <name> replaced by the name of the module. When using 多段階初期化 , non-ASCII module names are allowed. In ... this case, the initialization function name is PyInitU_ <name> , with <name> encoded using Python's punycode encoding with hyphens replaced by underscores. In Python: def initf ...
https://man.mtool.work/python/3.14/c-api/extension-modules.html
2. 拡張の型の定義: チュートリアル 9324
2. 拡張の型の定義: チュートリアル Python では、組み込みの str 型や list 型のような Python コードから操作できる新しい型を C 拡張モジュールの作者が定義できます。 全ての拡張の型のコードはあるパターンに従うのですが、書き始める前に理解しておくべ ... m" , . m_doc = "拡張型を作成するサンプルモジュール。" , . m_size = 0 , . m_slots = custom_module_slots , }; PyMODINIT_FUNC PyInit_custom ( void ) { return PyModuleDef_Init ( & custom_module ); } 一度に理解するにはかなりの量ですが、前の章で見たことのある ... ときに、この関数ポインタをインタープリターが見に行きます。 custom モジュールをどう定義し、実行するか。 モジュールを定義する PyInit_custom 関数と、それに関連する custom_module 構造体、および新しいモジュールオブジェクトを設定する custom_module_exec 関数が ... 2" , . m_doc = "拡張型を作成するサンプルモジュール。" , . m_size = 0 , . m_slots = custom_module_slots , }; PyMODINIT_FUNC PyInit_custom2 ( void ) { return PyModuleDef_Init ( & custom_module ); } モジュールのこのバージョンでは、いくつもの変更をおこない ...
https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
1. Extending Python with C or C++ 9087
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 ... = PyModuleDef_HEAD_INIT , . m_name = "spam" , . m_size = 0 , // 非負の値 . m_slots = spam_module_slots , }; PyMODINIT_FUNC PyInit_spam ( void ) { return PyModuleDef_Init ( & spam_module ); } 例外オブジェクトの Python での名前は spam.error であることに注 ... 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 the only non- static item defined in the module file: PyMODIN ... IT_FUNC PyInit_spam ( void ) { return PyModuleDef_Init ( & spam_module ); } Note that PyMODINIT_FUNC declares the function as PyObject * ...
https://man.mtool.work/python/3.14/extending/extending.html
Windows 上の Python FAQ 8288
Windows 上の Python FAQ Python プログラムを Windows で動かすにはどうしますか? これは必ずしも単純な質問ではありません。Windows コマンドラインからプログラムを実行するのに慣れてしまっている場合は、全て明らかなことに思えるでしょう; そうでない場 ... さい。 *.pyd ファイルは DLL と同じですか? はい、.pyd ファイルは DLL ですが、いくつか違いがあります。 foo.pyd という DLL には PyInit_foo() 関数が必要です。 Python で import foo と書くと、Python は foo.py や foo.pyc に加えて foo.pyd を探し、見つかれば PyIn ...
https://man.mtool.work/python/3.14/faq/windows.html
1. 他のアプリケーションへの Python の埋め込み 8160
1. 他のアプリケーションへの Python の埋め込み 前章では、 Python を拡張する方法、すなわち C 関数のライブラリを Python に結びつけて機能を拡張する方法について述べました。同じようなことを別の方法でも実行できます: それは、自分の C/C++ アプリケー ... m_base = PyModuleDef_HEAD_INIT , . m_name = "emb" , . m_size = 0 , . m_methods = emb_module_methods , }; static PyObject * PyInit_emb ( void ) { return PyModuleDef_Init ( & emb_module ); } 上のコードを main() 関数のすぐ上に挿入します。また、以下の二つの ... 文を Py_Initialize() の呼び出しの前に挿入します: numargs = argc ; PyImport_AppendInittab ( "emb" , & PyInit_emb ); この 2 行は、 numargs 変数を初期化し、埋め込まれた Python インタープリタから emb.numargs() 関数を利用できるようにし ...
https://man.mtool.work/python/3.14/extending/embedding.html
C API 拡張のフリースレッド対応 7815
C API 拡張のフリースレッド対応 CPython 3.13 から、 global interpreter lock (GIL) を無効にして実行する free threading という構成がサポートされています。 このドキュメントでは、C API を使う拡張をフリースレッドに対応させる方法を説明します。 C か ... ilation errors in the regular build. static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT , ... }; PyMODINIT_FUNC PyInit_mymodule ( void ) { PyObject * m = PyModule_Create ( & moduledef ); if ( m == NULL ) { return NULL ; } #ifdef Py_GIL_DISAB ...
https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
3. Python を構成する 7579
3. Python を構成する 3.1. ビルド要件 CPython をビルドするためには、次のものが必要です: C11 コンパイラ。 C11 オプション機能 は不要です。 Windows では、 Microsoft Visual Studio 2017 以降が必要です。 IEEE 754 浮動小数点数と 浮動小数点 Not-a-Nu ... Use Py_IMPORTED_SYMBOL otherwise. 共有ライブラリとしてビルドする C 拡張に誤って Py_BUILD_CORE_BUILTIN マクロを使用すると、 PyInit_ xxx () 関数がエクスポートされず、インポート時に ImportError が発生します。 3.5. コンパイラとリンカのフラグ ./configure ス ...
https://man.mtool.work/python/3.14/using/configure.html
PREV 1 NEXT