per page, with , order by , clip by
Results of 1 - 10 of about 34 for action (0.006 sec.)
argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー 13724
argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー Added in version 3.2. ソースコード: Lib/argparse.py 注釈 argparse は基本的なコマンドラインアプリケーションの実装に推奨される標準ライブラリのモジュールですが、動作を厳密 ... ) # 位置引数 parser . add_argument ( '-c' , '--count' ) # 値を取るオプション parser . add_argument ( '-v' , '--verbose' , action = 'store_true' ) # オン/オフフラグ ArgumentParser.parse_args() メソッドはパーサーを実行し、抽出したデータを argparse.Names ... : >>> parser = argparse . ArgumentParser ( prog = 'PROG' , allow_abbrev = False ) >>> parser . add_argument ( '--foobar' , action = 'store_true' ) >>> parser . add_argument ( '--foonley' , action = 'store_false' ) >>> parser . parse_args ([ '--foon' ]) ... parser = argparse . ArgumentParser ( exit_on_error = False ) >>> parser . add_argument ( '--integers' , type = int ) _StoreAction(option_strings=['--integers'], dest='integers', nargs=None, const=None, default=None, type=<class 'int'>, choices=None, he ...
https://man.mtool.work/python/3.14/library/argparse.html
optparse --- コマンドラインオプションのパーサー 13580
optparse --- コマンドラインオプションのパーサー ソースコード: Lib/optparse.py 引数解析ライブラリの選択 標準ライブラリには、引数を解析するライブラリが三つあります。 getopt : C の手続き型の getopt API に忠実に対応するモジュールです。 optparse ... ser = optparse . OptionParser () parser . add_option ( '-o' , '--output' ) parser . add_option ( '-v' , dest = 'verbose' , action = 'store_true' ) opts , args = parser . parse_args () process ( args , output = opts . output , verbose = opts . verbose ) ... argparse . ArgumentParser () parser . add_argument ( '-o' , '--output' ) parser . add_argument ( '-v' , dest = 'verbose' , action = 'store_true' ) parser . add_argument ( 'rest' , nargs = '*' ) args = parser . parse_args () process ( args . rest , outp ... "--file" , dest = "filename" , help = "write report to FILE" , metavar = "FILE" ) parser . add_option ( "-q" , "--quiet" , action = "store_false" , dest = "verbose" , default = True , help = "don't print status messages to stdout" ) ( options , args ) ...
https://man.mtool.work/python/3.14/library/optparse.html
Argparse チュートリアル 10209
Argparse チュートリアル author : Tshepang Mbambo このチュートリアルでは、 argparse を丁寧に説明します。 argparse は、Python 標準ライブラリの一部であり、おすすめのコマンドライン引数の解析モジュールです。 注釈 標準ライブラリには、コマンドライ ... argparse parser = argparse . ArgumentParser () parser . add_argument ( "--verbose" , help = "increase output verbosity" , action = "store_true" ) args = parser . parse_args () if args . verbose : print ( "verbosity turned on" ) 実行してみましょう: $ p ... 要とするのではなく、単なるフラグになりました。この考え方に沿うようにオプションの名前も変更しています。ここで新しいキーワード action を指定し、値として "store_true" を設定していることに注意してください。これは、オプションが指定された場合に値として True を ... se parser = argparse . ArgumentParser () parser . add_argument ( "-v" , "--verbose" , help = "increase output verbosity" , action = "store_true" ) args = parser . parse_args () if args . verbose : print ( "verbosity turned on" ) 上記のプログラムを実行す ...
https://man.mtool.work/python/3.14/howto/argparse.html
sched --- イベントスケジューラー 10001
sched --- イベントスケジューラー ソースコード: Lib/sched.py sched モジュールは、汎用的なイベントスケジューラーを実装するクラスを定義しています: class sched. scheduler ( timefunc = time.monotonic , delayfunc = time.sleep ) scheduler クラスは ... スケジューラオブジェクト scheduler インスタンスは以下のメソッドと属性を持っています: scheduler. enterabs ( time , priority , action , argument = () , kwargs = {} ) 新しいイベントをスケジュールします。 引数 time は、コンストラクタへ渡された timefunc の戻り ... されたイベントは、それらの priority によって実行されます。 数値の小さい方が高い優先度となります。 イベントを実行することは、 action(*argument, **kwargs) を実行することを意味します。 argument は action のための位置引数を保持するシーケンスでなければいけませ ... ん。 kwargs は action のためのキーワード引数を保持する辞書でなければいけません。 戻り値は、後にイベントをキャンセルする時に使われる可能性のあるイ ...
https://man.mtool.work/python/3.14/library/sched.html
optparse を使うコードを argparse に移行する 8547
optparse を使うコードを argparse に移行する argparse モジュールは、 optparse モジュールに標準では備わっていない、次のような高水準の機能を提供します。 位置引数を扱う サブコマンドのサポート。 + , / のような代替オプションプレフィクスを許容する ... zero-or-more スタイル、one-or-more スタイルの引数を扱う より有益な使用方法メッセージの生成 カスタム type , カスタム action のために遥かに簡単なインターフェイスを提供する argparse モジュールは、当初 optparse との互換性を保とうとしていました。 しか ... arse_args() ではなく parse_intermixed_args() で置き換える。 コールバック・アクションと callback_* キーワード引数を type や action 引数に置き換える。 type キーワード引数に渡す型名の文字列を、対応する型オブジェクト (例えば int 、 float 、 complex など) に ... う場合のフォーマット文字列に置き換える。 OptionParser のコンストラクターの version 引数を、 parser.add_argument('--version', action='version', version='<the version>') に置き換える 他のマニュアルの関連ページ Django custom-management-commands PHP migratio ...
https://man.mtool.work/python/3.14/howto/argparse-optparse.html
warnings --- 警告の制御 8356
warnings --- 警告の制御 ソースコード: Lib/warnings.py 警告メッセージは一般に、ユーザに警告しておいた方がよいような状況下にプログラムが置かれているが、その状況は (通常は) 例外を送出したりそのプログラムを終了させるほどの正当な理由がないといっ ... までリスト中の各フィルタとの照合が行われます; 一致したフィルタ仕様がその警告の処理方法を決定します。フィルタの各エントリは ( action , message , category , module , lineno ) からなるタプルです。ここで: action は以下の文字列のうちの一つです: 値 処理方法 "d ... sys.stderr にメッセージを出力した後、無視します)。 個々の警告フィルタは、コロンで区切ったフィールドの列として指定します。 action : message : category : module : line 各フィールドの意味は 警告フィルタ で説明しています。 PYTHONWARNINGS のように複数のフィ ... try__ dictionary of the module. If no registry is passed, each warning is treated as the first occurrence, that is, filter actions "default" , "module" and "once" are handled as "always" . module_globals は、もし与えられるならば、警告が発せられるコード ...
https://man.mtool.work/python/3.14/library/warnings.html
termios --- POSIX スタイルの端末制御 8212
termios --- POSIX スタイルの端末制御 このモジュールでは端末 I/O 制御のための POSIX 準拠の関数呼び出しインターフェースを提供します。これら呼び出しのための完全な記述については、 Unix マニュアルページの termios(3) を参照してください。これは PO ... USH Values for the queue selector: the input queue, the output queue, or both queues, respectively. termios. tcflow ( fd , action ) ファイル記述子 fd の入力または出力をサスペンドしたりレジュームしたりします。引数 action は出力をサスペンドする TCOOFF 、 ... 力をレジュームする TCION をとることができます。 termios. TCOOFF termios. TCOON termios. TCIOFF termios. TCION Values for the action argument: suspend output, restart output, suspend input, or restart input, respectively. termios. tcgetwinsize ( fd ) ファ ...
https://man.mtool.work/python/3.14/library/termios.html
venv --- 仮想環境の作成 8212
venv --- 仮想環境の作成 Added in version 3.3. ソースコード: Lib/venv/ venv モジュールは、軽量な「仮想環境」の作成に対応しています。 各仮想環境は、それぞれの site ディレクトリに独立した Python パッケージ群を持ちます。 仮想環境は、インストール ... directory in which to create the ' 'virtual environment.' ) parser . add_argument ( '--no-setuptools' , default = False , action = 'store_true' , dest = 'nodist' , help = "Don't install setuptools or pip in the " "virtual environment." ) parser . add_ ... argument ( '--no-pip' , default = False , action = 'store_true' , dest = 'nopip' , help = "Don't install pip in the virtual " "environment." ) parser . add_argument ( '--s ... ystem-site-packages' , default = False , action = 'store_true' , dest = 'system_site' , help = 'Give the virtual environment access to the ' 'system site-packages dir.' ) ...
https://man.mtool.work/python/3.14/library/venv.html
4. その他の制御フローツール 8148
4. その他の制御フローツール 前章で紹介した while 文の他にも、 Python にはいくつか制御フローツールがあり、本章で説明します。 4.1. if 文 おそらく最もおなじみの文型は if 文でしょう。例えば: >>> x = int ( input ( "Please enter an integer: " )) ... という形式の キーワード引数 を使って呼び出すこともできます。例えば、以下の関数: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , volt ... ly plumage, the" , type ) print ( "-- It's" , state , "!" ) は、1つの必須引数 ( voltage ) と3つのオプション引数 ( state 、 action 、 type ) を受け付けます。この関数は以下のいずれかの方法で呼び出せます。 parrot ( 1000 ) # 1つの位置引数 parrot ( voltage ... = 1000 ) # 1つのキーワード引数 parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2つのキーワード引数 parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2つのキーワード引数 parrot ( 'a mi ...
https://man.mtool.work/python/3.14/tutorial/controlflow.html
pty --- 擬似端末ユーティリティ 7828
pty --- 擬似端末ユーティリティ ソースコード: Lib/pty.py pty モジュールは、別のプロセスを起動してその制御端末をプログラムから読み書きする、擬似端末の操作を定義します。 利用可能な環境 : Unix. 擬似端末の扱いはプラットフォームに大きく依存します ... s import pty import sys import time parser = argparse . ArgumentParser () parser . add_argument ( '-a' , dest = 'append' , action = 'store_true' ) parser . add_argument ( '-p' , dest = 'use_python' , action = 'store_true' ) parser . add_argument ( 'fil ...
https://man.mtool.work/python/3.14/library/pty.html
PREV 1 2 3 4 NEXT