Results of 1 - 10 of about 278 for args (0.010 sec.)
- Argparse チュートリアル — Python 3.14.8 ドキュメント 9817
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » コマンドラインインターフェースライブラリ » argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー » Argparse チュー
...(ほとんど)何もしない、とても簡単な例から始めましょう: import argparse parser = argparse . ArgumentParser () parser . parse_args () 下記がこのコードを実行した結果です: $ python prog.py $ python prog.py --help usage: prog.py [-h] options: -h, --help sh...位置引数の入門 ¶ 以下に例を示します: import argparse parser = argparse . ArgumentParser () parser . add_argument ( "echo" ) args = parser . parse_args () print ( args . echo ) このコードを実行してみましょう: $ python prog.py usage: prog.py [-h] echo p...こでは、その機能にあわせて引数名を echo としました。 プログラムを実行すると、オプションを指定するように要求されます。 parse_args() メソッドは指定されたオプションを、この場合は echo として、返します。 この変数は argparse が自動的に行うある種の魔法です(... - https://man.mtool.work/python/3.14/howto/argparse.html
- Argparse チュートリアル — Python 3.14.8 ドキュメント 9817
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » コマンドラインインターフェースライブラリ » argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー » Argparse チュー
...(ほとんど)何もしない、とても簡単な例から始めましょう: import argparse parser = argparse . ArgumentParser () parser . parse_args () 下記がこのコードを実行した結果です: $ python prog.py $ python prog.py --help usage: prog.py [-h] options: -h, --help sh...位置引数の入門 ¶ 以下に例を示します: import argparse parser = argparse . ArgumentParser () parser . add_argument ( "echo" ) args = parser . parse_args () print ( args . echo ) このコードを実行してみましょう: $ python prog.py usage: prog.py [-h] echo p...こでは、その機能にあわせて引数名を echo としました。 プログラムを実行すると、オプションを指定するように要求されます。 parse_args() メソッドは指定されたオプションを、この場合は echo として、返します。 この変数は argparse が自動的に行うある種の魔法です(... - https://man.mtool.work/python/3.14/howto/argparse.html
- argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー — Pytho... 9584
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » コマンドラインインターフェースライブラリ » argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー テーマ 自動 ライ
...を取るオプション parser . add_argument ( '-v' , '--verbose' , action = 'store_true' ) # オン/オフフラグ ArgumentParser.parse_args() メソッドはパーサーを実行し、抽出したデータを argparse.Namespace オブジェクト内に配置します: args = parser . parse_args (...) print ( args . filename , args . count , args . verbose ) 注釈 If you're looking for a guide about how to upgrade optparse code to argp...arser = argparse . ArgumentParser ( prog = 'PROG' , usage = ' %(prog)s [options]' ) >>> parser . add_argument ( '--foo' , nargs = '?' , help = 'foo help' ) >>> parser . add_argument ( 'bar' , nargs = '+' , help = 'bar help' ) >>> parser . print_help... - https://man.mtool.work/python/3.14/library/argparse.html
- argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー — Pytho... 9584
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » コマンドラインインターフェースライブラリ » argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー テーマ 自動 ライ
...を取るオプション parser . add_argument ( '-v' , '--verbose' , action = 'store_true' ) # オン/オフフラグ ArgumentParser.parse_args() メソッドはパーサーを実行し、抽出したデータを argparse.Namespace オブジェクト内に配置します: args = parser . parse_args (...) print ( args . filename , args . count , args . verbose ) 注釈 If you're looking for a guide about how to upgrade optparse code to argp...arser = argparse . ArgumentParser ( prog = 'PROG' , usage = ' %(prog)s [options]' ) >>> parser . add_argument ( '--foo' , nargs = '?' , help = 'foo help' ) >>> parser . add_argument ( 'bar' , nargs = '+' , help = 'bar help' ) >>> parser . print_help... - https://man.mtool.work/python/3.14/library/argparse.html
- getopt --- C-style parser for command line options — Python 3.14.8 ドキュメント 8654
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Superseded Modules » getopt --- C-style parser for command line options テーマ 自動 ライト ダーク | getopt --- C-style parser for c
...an argument parsing library for additional details. このモジュールは2つの関数と1つの例外を提供しています: getopt. getopt ( args , shortopts , longopts = [] ) ¶ Parses command line options and parameter list. args is the argument list to be parsed, wi...います: 最初は (option, value) のタプルのリスト、2つ目はオプションリストを取り除いたあとに残ったプログラムの引数リストです ( args の末尾部分のスライスになります)。それぞれの引数と値のタプルの最初の要素は、短形式の時はハイフン 1つで始まる文字列 (例: '-x...。長形式と短形式のオプションは混在できます。 バージョン 3.14 で変更: Optional arguments are supported. getopt. gnu_getopt ( args , shortopts , longopts = [] ) ¶ この関数はデフォルトで GNU スタイルのスキャンモードを使う以外は getopt() と同じように動作し... - https://man.mtool.work/python/3.14/library/getopt.html
- getopt --- C-style parser for command line options — Python 3.14.8 ドキュメント 8654
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Superseded Modules » getopt --- C-style parser for command line options テーマ 自動 ライト ダーク | getopt --- C-style parser for c
...an argument parsing library for additional details. このモジュールは2つの関数と1つの例外を提供しています: getopt. getopt ( args , shortopts , longopts = [] ) ¶ Parses command line options and parameter list. args is the argument list to be parsed, wi...います: 最初は (option, value) のタプルのリスト、2つ目はオプションリストを取り除いたあとに残ったプログラムの引数リストです ( args の末尾部分のスライスになります)。それぞれの引数と値のタプルの最初の要素は、短形式の時はハイフン 1つで始まる文字列 (例: '-x...。長形式と短形式のオプションは混在できます。 バージョン 3.14 で変更: Optional arguments are supported. getopt. gnu_getopt ( args , shortopts , longopts = [] ) ¶ この関数はデフォルトで GNU スタイルのスキャンモードを使う以外は getopt() と同じように動作し... - https://man.mtool.work/python/3.14/library/getopt.html
- Call プロトコル — Python 3.14.8 ドキュメント 8295
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » Call プロトコル テーマ 自動 ライト ダーク | Call プロトコル ¶ CPython supports
...classes that set tp_call are callable. The signature of the slot is: PyObject * tp_call ( PyObject * callable , PyObject * args , PyObject * kwargs ); A call is made using a tuple for the positional arguments and a dict for the keyword arguments, sim...ilarly to callable(*args, **kwargs) in Python code. args must be non-NULL (use an empty tuple if there are no arguments) but kwargs may be NULL if...mplement vectorcall if that would be slower than tp_call . For example, if the callee needs to convert the arguments to an args tuple and kwargs dict anyway, then there is no point in implementing vectorcall. Classes can implement the vectorcall prot... - https://man.mtool.work/python/3.14/c-api/call.html
- Call プロトコル — Python 3.14.8 ドキュメント 8295
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » Call プロトコル テーマ 自動 ライト ダーク | Call プロトコル ¶ CPython supports
...classes that set tp_call are callable. The signature of the slot is: PyObject * tp_call ( PyObject * callable , PyObject * args , PyObject * kwargs ); A call is made using a tuple for the positional arguments and a dict for the keyword arguments, sim...ilarly to callable(*args, **kwargs) in Python code. args must be non-NULL (use an empty tuple if there are no arguments) but kwargs may be NULL if...mplement vectorcall if that would be slower than tp_call . For example, if the callee needs to convert the arguments to an args tuple and kwargs dict anyway, then there is no point in implementing vectorcall. Classes can implement the vectorcall prot... - https://man.mtool.work/python/3.14/c-api/call.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 7976
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...None , side_effect = None , return_value = DEFAULT , wraps = None , name = None , spec_set = None , unsafe = False , ** kwargs ) ¶ 新しい Mock オブジェクトを作成します。 Mock はモックオブジェクトの挙動を指定するオプション引数をいくつか取ります: spec...d 'method' to have been called once. Called 2 times. Calls: [call(), call()]. Added in version 3.6. assert_called_with ( * args , ** kwargs ) ¶ This method is a convenient way of asserting that the last call has been made in a particular way: >>> moc...='mock.method()' id='...'> >>> mock . method . assert_called_with ( 1 , 2 , 3 , test = 'wow' ) assert_called_once_with ( * args , ** kwargs ) ¶ モックが一度だけ呼び出され、かつ指定された引数で呼び出されたことをアサートします。 >>> mock = Mock ( retur... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 7976
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...None , side_effect = None , return_value = DEFAULT , wraps = None , name = None , spec_set = None , unsafe = False , ** kwargs ) ¶ 新しい Mock オブジェクトを作成します。 Mock はモックオブジェクトの挙動を指定するオプション引数をいくつか取ります: spec...d 'method' to have been called once. Called 2 times. Calls: [call(), call()]. Added in version 3.6. assert_called_with ( * args , ** kwargs ) ¶ This method is a convenient way of asserting that the last call has been made in a particular way: >>> moc...='mock.method()' id='...'> >>> mock . method . assert_called_with ( 1 , 2 , 3 , test = 'wow' ) assert_called_once_with ( * args , ** kwargs ) ¶ モックが一度だけ呼び出され、かつ指定された引数で呼び出されたことをアサートします。 >>> mock = Mock ( retur... - https://man.mtool.work/python/3.14/library/unittest.mock.html