Python 3.6.5 ドキュメント 検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 99 for try (0.028 sec.)
8. エラーと例外 — Python 3.6.5 ドキュメント 16698
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python チュートリア ... ということに注意してください。 >>> while True : ... try : ... x = int ( input ( "Please enter a number: " ... ror : ... print ( "Oops! That was no valid number. Try again..." ) ... try 文は下記のように動作します。 ま ... ず、 try 節 (try clause) (キーワード try と except の間の文 ... 何も例外が発生しなければ、 except 節 をスキップして try 文の実行を終えます。 try 節内の実行中に例外が発生す ...
https://man.plustar.jp/python/tutorial/errors.html - [similar]
8. 複合文 (compound statement) — Python 3.6.5 ドキュメント 12188
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 言語リファレ ... よび for 文は、伝統的な制御フロー構成を実現します。 try は例外処理および/または一連の文に対するクリーンアッ ... ompound_stmt ::= if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | async_with ... : for x in a [:]: if x < 0 : a . remove ( x ) 8.4. try 文 ¶ try 文は、ひとまとめの文に対して、例外処理およ ... び/またはクリーンアップコードを指定します: try_stmt ::= try1_stmt | try2_stmt try1_stmt ::= "try" ...
https://man.plustar.jp/python/reference/compound_stmts.html - [similar]
29.6. contextlib --- with 文コンテキスト用ユーティリティ — Python 3.6.5 ドキュ... 8668
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... り、クリーンアップ処理を確実に実行したりするために、 try ... except ... finally 構文を使用できます。例外を捕 ... textmanager @contextmanager def closing ( thing ): try : yield thing finally : thing . close () そして、明 ... move ( 'someotherfile.tmp' ) これは以下と等価です: try : os . remove ( 'somefile.tmp' ) except FileNotFou ... ndError : pass try : os . remove ( 'someotherfile.tmp' ) except FileN ...
https://man.plustar.jp/python/library/contextlib.html - [similar]
27.5. timeit --- 小さなコード断片の実行時間計測 — Python 3.6.5 ドキュメント 8277
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ルパーです。 利用例: t = Timer ( ... ) # outside the try/except try : t . timeit ( ... ) # or t.repeat(...) ... 存在しない属性に対してテストするために hasattr() と try / except を使用した場合のコストを比較しています: $ ... python -m timeit 'try:' ' str.__bool__' 'except AttributeError:' ' pass' ... best of 3: 4.26 usec per loop $ python -m timeit 'try:' ' int.__bool__' 'except AttributeError:' ' pass' ...
https://man.plustar.jp/python/library/timeit.html - [similar]
What's New in Python 2.3 — Python 3.6.5 ドキュメント 7769
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » What's New in Pytho ... 関数が実行を再開します。(複雑な理由により、 yield は try ... finally の try ブロック内に含めることは許されて ... して下さい。) --- (---訳注: Python 2.5 の PEP 342 で try ... finally 内に置けないという制約はなくなりました ... 。また、 try ... finally の try 、とここであえて特定しているのは ... 、同じく 2.5 の PEP 341 によって try/except/finally の一体化されるまでは、 finally の t ...
https://man.plustar.jp/python/whatsnew/2.3.html - [similar]
10.1. itertools --- 効率的なループ実行のためのイテレータ生成関数 — Python 3.6.5... 7677
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... rator.mul) --> 1 2 6 24 120 it = iter ( iterable ) try : total = next ( it ) except StopIteration : retur ... self . currkey == tgtkey : yield self . currvalue try : self . currvalue = next ( self . it ) except Sto ... ep or 1 it = iter ( range ( start , stop , step )) try : nexti = next ( it ) except StopIteration : # Con ... in zip ( range ( start ), iterable ): pass return try : for i , element in enumerate ( iterable ): if i ...
https://man.plustar.jp/python/library/itertools.html - [similar]
What's New in Python 2.5 — Python 3.6.5 ドキュメント 7573
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » What's New in Pytho ... り良いハンドリングを行えるようになりました( PEP 341: try/except/finally の一体化 セクション)。これらのどの改 ... トとして実行する PEP 著と実装 Nick Coghlan. PEP 341: try/except/finally の一体化 ¶ Python 2.5 までは try... on 2.5 では、あなたは今ではこう書くことが出来ます: try : block - 1 ... except Exception1 : handler - 1 .. ... 内のコードはそれでも実行されます。 参考 PEP 341 - try-except と try-finally を一体化する PEP 著 Georg Br ...
https://man.plustar.jp/python/whatsnew/2.5.html - [similar]
10. 完全な文法仕様 — Python 3.6.5 ドキュメント 7273
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 言語リファレ ... compound_stmt : if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated ... rlist 'in' testlist ':' suite [ 'else' ':' suite ] try_stmt : ( 'try' ':' suite (( except_clause ':' suit ...
https://man.plustar.jp/python/reference/grammar.html - [similar]
7. 単純文 (simple statement) — Python 3.6.5 ドキュメント 7273
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 言語リファレ ... け出します。 return によって、 finally 節をともなう try 文の外に処理が引き渡されると、実際に関数から抜ける ... ハンドルされなければ、両方の例外が印字されます: >>> try : ... print ( 1 / 0 ) ... except Exception as exc ... が、新しい例外の __context__ 属性に付与されます: >>> try : ... print ( 1 / 0 ) ... except : ... raise Runti ... ることで、例外の連鎖を明示的に非表示にできます: >>> try : ... print ( 1 / 0 ) ... except : ... raise Runti ...
https://man.plustar.jp/python/reference/simple_stmts.html - [similar]
36.2. imp --- import 内部へのアクセス — Python 3.6.5 ドキュメント 7169
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... し側にはそれを閉じる責任があります。これを行うには、 try ... finally 文を使うことが最も良いです。 バージョン ... 効性を引き出すために使うことができます --- つまり、 try 文を使えば、必要に応じてテーブルがあるかどうかをテ ... ストし、その初期化を飛ばすことができます: try : cache except NameError : cache = {} ビルトインの ... path: see if the module has already been imported. try : return sys . modules [ name ] except KeyError : ...
https://man.plustar.jp/python/library/imp.html - [similar]
PREV 1 2 3 4 5 6 7 8 9 10 NEXT