per page, with , order by , clip by
Results of 1 - 10 of about 20 for printf (0.009 sec.)
DTrace と SystemTap で CPython を測定する 13289
DTrace と SystemTap で CPython を測定する author : David Malcolm author : Łukasz Langa Dtrace と SystemTap はモニタリングツールで、コンピュータシステムのプロセスが何をしているかを調べる方法を提供します。 どちらもドメイン固有言語 (domain-spe ... n$target:::function-entry /copyinstr(arg1) == "start"/ { self->trace = 1; } python$target:::function-entry /self->trace/ { printf("%d\t%*s:", timestamp, 15, probename); printf("%*s", self->indent, ""); printf("%s:%s:%d\n", basename(copyinstr(arg0)), co ... pyinstr(arg1), arg2); self->indent++; } python$target:::function-return /self->trace/ { self->indent--; printf("%d\t%*s:", timestamp, 15, probename); printf("%*s", self->indent, ""); printf("%s:%s:%d\n", basename(copyinstr(arg0)), co ... process("python").mark("function__entry") { filename = user_string($arg1); funcname = user_string($arg2); lineno = $arg3; printf("%s => %s in %s:%d\\n", thread_indent(1), funcname, filename, lineno); } probe process("python").mark("function__return") ...
https://man.mtool.work/python/3.14/howto/instrumentation.html
バイトオブジェクト 13034
バイトオブジェクト 下記の関数は、バイトオブジェクトを期待している引数にバイトオブジェクトでないパラメタを指定して呼び出されると、 TypeError を送出します。 PyBytesObject の内部バッファには、null 終端の C 文字列との互換性のため、末尾に常に追加 ... _FromFormat ( const char * format , ... ) 戻り値: 新しい参照。 次に属します: Stable ABI . Thread safety: Atomic . C 関数の printf() スタイルの format 文字列と可変長の引数を取り、結果のPython バイトオブジェクトのサイズを計算し、値を指定した書式にしたがっ ... ーマット文字が使用できます: 書式指定文字 型 備考 %% n/a リテラルの % 文字 %c int C の整数型で表現される単一のバイト。 %d int printf("%d") と同等。 [ 1 ] %u unsigned int printf("%u") と同等。 [ 1 ] %ld long printf("%ld") と同等。 [ 1 ] %lu unsigned long p ... rintf("%lu") と同等。 [ 1 ] %zd Py_ssize_t printf("%zd") と同等。 [ 1 ] %zu size_t printf("%zu") と同等。 [ 1 ] %i int printf("%i") と同等。 [ 1 ] %x int printf("%x") と同等 ...
https://man.mtool.work/python/3.14/c-api/bytes.html
ctypes --- Python 用の外部関数ライブラリ 10808
ctypes --- Python 用の外部関数ライブラリ ソースコード: Lib/ctypes ctypes は Python 用の外部関数ライブラリです。 C と互換性のあるデータ型を提供し、DLL や共有ライブラリの関数を呼び出せます。 これらのライブラリを純粋な Python でラップするために ... ylib', handle ... at ...> ロードしたdllから関数にアクセスする dll オブジェクトの属性として関数にアクセスします: >>> libc . printf <_FuncPtr object at 0x...> >>> print ( windll . kernel32 . GetModuleHandleA ) <_FuncPtr object at 0x...> >>> print ( windl ... e 文字を格納する変更可能なメモリブロックを作成するには、 create_unicode_buffer() 関数を使ってください。 続・関数を呼び出す printf は sys.stdout では なく 、本物の標準出力チャンネルへプリントすることに注意してください。したがって、これらの例はコンソール ... プロンプトでのみ動作し、 IDLE や PythonWin では動作しません。: >>> printf = libc . printf >>> printf ( b "Hello, %s \n " , b "World!" ) Hello, World! 14 >>> printf ( b "Hello, %S \n " , "World!" ) ...
https://man.mtool.work/python/3.14/library/ctypes.html
組み込み型 8207
組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ ... とにまとめたものです。 カテゴリ str メソッド bytes または bytearray メソッド 書式化 str.format() str.format_map() f-strings printf 形式の文字列書式化 printf 形式での bytes の書式化 検索と置換 str.find() str.rfind() bytes.find() bytes.rfind() str.index() ... マイズできます ( str.format() 、 書式文字列の構文 、および 文字列の書式化のカスタマイズ を参照してください)。他方は C 言語の printf 形式の書式化に基づいてより狭い範囲と型を扱うもので、正しく扱うのは少し難しいですが、扱える場合ではたいていこちらのほうが高 ... 速です ( printf 形式の文字列書式化 )。 標準ライブラリの テキスト処理サービス 節は、その他テキストに関する様々なユーティリティ ( re モジュー ...
https://man.mtool.work/python/3.14/builtins/stdtypes.html
Unicode オブジェクトと codec 8207
Unicode オブジェクトと codec Unicode オブジェクト Python 3.3 で PEP 393 が実装されて以来、Unicode オブジェクトは内部で複数の表現形式を使っています。 これにより、メモリ効率を維持しながら Unicode 文字の全範囲を扱えます。 すべてのコードポイント ... します。 PyObject * PyUnicode_FromFormat ( const char * format , ... ) 戻り値: 新しい参照。 次に属します: Stable ABI . C の printf() 形式の書式文字列 format と可変個数の引数を受け取り、結果の Python Unicode 文字列のサイズを計算し、値を書式化した文字列を ... int 1 文字。 s const char * または const wchar_t * null で終端された C の文字列。 p const void * C ポインタの 16 進表記。 printf("%p") とほとんど同じですが、プラットフォームにおける printf の定義に関わりなく先頭にリテラル 0x が付きます。 A PyObject * ... 使う場合) です。 "%A" 、 "%U" 、 "%S" 、 "%R" 、および PyObject* 引数が NULL でない場合の "%V" では、文字数です。 注釈 C の printf() とは異なり、整数変換 ( d 、 i 、 u 、 o 、 x 、 X ) で精度を指定しても 0 フラグは有効です。 バージョン 3.2 で変更: "%lld ...
https://man.mtool.work/python/3.14/c-api/unicode.html
2. Unix プラットフォームで Python を使う 8089
2. Unix プラットフォームで Python を使う 2.1. 最新バージョンの Python の取得とインストール 2.1.1. Linux ほとんどの Linux ディストリビューションには Python があらかじめインストールされており、それ以外のディストリビューションでもパッケージとし ... そのディレクトリには cert.pem ファイル、 certs ディレクトリ、またはその両方もあるはずです。 $ find /etc/ -name openssl.cnf -printf "%h\n" /etc/ssl OpenSSL をダウンロードし、ビルドしてインストールします。 install ではなく、必ず install_sw を使用してくださ ...
https://man.mtool.work/python/3.14/using/unix.html
Python 初期化設定 7851
Python 初期化設定 PyInitConfig C API Added in version 3.14. Python は Py_InitializeFromInitConfig() で初期化できます。 Py_RunMain() 関数は、カスタマイズされた Python プログラムを書くために使用できます。 Initialization, Finalization, and Thr ... エラー時は -1 を返します: int init_python ( void ) { PyInitConfig * config = PyInitConfig_Create (); if ( config == NULL ) { printf ( "PYTHON INIT ERROR: memory allocation failed \n " ); return -1 ; } // Python 開発モードを有効化 if ( PyInitConfig_SetInt ... / 作ることができないために使用されています。 const char * err_msg ; ( void ) PyInitConfig_GetError ( config , & err_msg ); printf ( "PYTHON INIT ERROR: %s \n " , err_msg ); PyInitConfig_Free ( config ); return -1 ; } } 設定の作成 struct PyInitConfig Py ...
https://man.mtool.work/python/3.14/c-api/init_config.html
1. 他のアプリケーションへの Python の埋め込み 7851
1. 他のアプリケーションへの Python の埋め込み 前章では、 Python を拡張する方法、すなわち C 関数のライブラリを Python に結びつけて機能を拡張する方法について述べました。同じようなことを別の方法でも実行できます: それは、自分の C/C++ アプリケー ... argc , char * argv []) { PyObject * pName , * pModule , * pFunc ; PyObject * pArgs , * pValue ; int i ; if ( argc < 3 ) { fprintf ( stderr , "Usage: call pythonfile funcname [args] \n " ); return 1 ; } Py_Initialize (); pName = PyUnicode_DecodeFSDefaul ... + i ) { pValue = PyLong_FromLong ( atoi ( argv [ i + 3 ])); if ( ! pValue ) { Py_DECREF ( pArgs ); Py_DECREF ( pModule ); fprintf ( stderr , "Cannot convert argument \n " ); return 1 ; } /* ここで pValue の参照が盗まれる: */ PyTuple_SetItem ( pArgs , i ... , pValue ); } pValue = PyObject_CallObject ( pFunc , pArgs ); Py_DECREF ( pArgs ); if ( pValue != NULL ) { printf ( "Result of call: %ld \n " , PyLong_AsLong ( pValue )); Py_DECREF ( pValue ); } else { Py_DECREF ( pFunc ); Py_DECREF ( p ...
https://man.mtool.work/python/3.14/extending/embedding.html
1. Extending Python with C or C++ 7851
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 ... onfig ); /* Add a built-in module, before Py_Initialize */ if ( PyImport_AppendInittab ( "spam" , PyInit_spam ) == -1 ) { fprintf ( stderr , "Error: could not extend in-built modules table \n " ); exit ( 1 ); } /* Pass argv[0] to the Python interpreter ... embedded script imports it. */ PyObject * pmodule = PyImport_ImportModule ( "spam" ); if ( ! pmodule ) { PyErr_Print (); fprintf ( stderr , "Error: could not import module 'spam' \n " ); } // ... use Python C API here ... return 0 ; exception : PyConf ... PyArg_ParseTupleAndKeywords ( args , keywds , "i|sss" , kwlist , & voltage , & state , & action , & type )) return NULL ; printf ( "-- This parrot wouldn't %s if you put %i Volts through it. \n " , action , voltage ); printf ( "-- Lovely plumage, the ...
https://man.mtool.work/python/3.14/extending/extending.html
logging --- Python 用のログ記録手段 7851
logging --- Python 用のログ記録手段 ソースコード: Lib/logging/__init__.py Important このページには、リファレンス情報だけが含まれています。チュートリアルは、以下のページを参照してください 基本チュートリアル 上級チュートリアル ロギングクックブ ... 使います。 style ( str ) -- '%' 、 '{' または '$' のいずれかで、書式文字列がログデータとどのようにマージされるかを決めます: printf 形式の文字列書式化 ( % ), str.format() ( { ) または string.Template ( $ ) のいずれかを使います。 この引数は fmt だけに適用 ... ものを使います。 style format が指定された場合、書式文字列にこのスタイルを仕様します。 '%' , '{' , '$' のうち1つで、それぞれ printf-style , str.format() , string.Template に対応します。 デフォルトは '%' です。 level ルートロガーのレベルを指定された レベル ...
https://man.mtool.work/python/3.14/library/logging.html
PREV 1 2 NEXT