per page, with , order by , clip by
Results of 1 - 5 of about 5 for equals (0.003 sec.)
Argparse チュートリアル 12795
Argparse チュートリアル author : Tshepang Mbambo このチュートリアルでは、 argparse を丁寧に説明します。 argparse は、Python 標準ライブラリの一部であり、おすすめのコマンドライン引数の解析モジュールです。 注釈 標準ライブラリには、コマンドライ ... ) args = parser . parse_args () answer = args . square ** 2 if args . verbose : print ( f "the square of { args . square } equals { answer } " ) else : print ( answer ) 出力は以下のようになります: $ python prog.py usage: prog.py [-h] [-v] square prog.p ... y: error: the following arguments are required: square $ python prog.py 4 16 $ python prog.py 4 --verbose the square of 4 equals 16 $ python prog.py --verbose 4 the square of 4 equals 16 位置引数を元に戻したので、引数を指定しないとエラーになりました。 ... = parser . parse_args () answer = args . square ** 2 if args . verbosity == 2 : print ( f "the square of { args . square } equals { answer } " ) elif args . verbosity == 1 : print ( f " { args . square } ^2 == { answer } " ) else : print ( answer ) 実行 ...
https://man.mtool.work/python/3.14/howto/argparse.html
4. その他の制御フローツール 8861
4. その他の制御フローツール 前章で紹介した while 文の他にも、 Python にはいくつか制御フローツールがあり、本章で説明します。 4.1. if 文 おそらく最もおなじみの文型は if 文でしょう。例えば: >>> x = int ( input ( "Please enter an integer: " )) ... for 文を以下に示します: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # 因数が見つからないとループは最後まで実行される ... print ( n , 'is a prim ... e number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (そう、これは正しいコードです。 ...
https://man.mtool.work/python/3.14/tutorial/controlflow.html
site --- サイト固有の設定フック 8199
site --- サイト固有の設定フック ソースコード: Lib/site.py このモジュールは初期化中に自動的にインポートされます。 自動インポートはインタプリタの -S オプションで禁止できます。 Importing this module normally appends site-specific paths to the ... packages directory. If this import fails with an ImportError or its subclass exception, and the exception's name attribute equals 'sitecustomize' , it is silently ignored. If Python is started without output streams available, as with pythonw.exe on Wi ...
https://man.mtool.work/python/3.14/library/site.html
tokenize --- Python ソース用のトークナイザー 8199
tokenize --- Python ソース用のトークナイザー ソースコード: Lib/tokenize.py The tokenize module provides a lexical scanner for Python source code, implemented in Python. The scanner in this module returns comments as tokens as well, making i ... entifying the specific operator type for OP tokens, as defined by the constants in token . For all other token types, this equals type . For example, a + token has type equal to OP and exact_type equal to PLUS . Added in version 3.3. token モジュールの ...
https://man.mtool.work/python/3.14/library/tokenize.html
test --- Python の回帰テストパッケージ 7850
test --- Python の回帰テストパッケージ 注釈 test パッケージは Python 内部での使用のみを目的としています。 このドキュメントは Python のコア開発者向けに用意されています。 ここで説明するコードは Python のリリース間で予告なく変更または削除される ... t.support. checksizeof ( test , o , size ) For testcase test , assert that the sys.getsizeof for o plus the GC header size equals size . @ test.support. anticipate_failure ( condition ) 条件に応じてテストに @unittest.expectedFailure を付けるデコレータで ...
https://man.mtool.work/python/3.14/library/test.html
PREV 1 NEXT