Results of 1 - 9 of about 9 for outfile (0.007 sec.)
- 11. 標準ライブラリをひとめぐり --- その II 11701
- 11. 標準ライブラリをひとめぐり --- その II ツアーの第2部では、プロフェッショナルプログラミングを支えるもっと高度なモジュールをカバーします。ここで挙げるモジュールは、小さなスクリプトの開発ではほとんど使いません。 11.1. 出力のフォーマット re
...うにする方法を示しています: import threading , zipfile class AsyncZip ( threading . Thread ): def __init__ ( self , infile , outfile ): super () . __init__ () self . infile = infile self . outfile = outfile def run ( self ): with zipfile . ZipFile ( self.... outfile , 'w' , zipfile . ZIP_DEFLATED ) as f : f . write ( self . infile ) print ( 'Finished background zip of:' , self . infile... - https://man.mtool.work/python/3.14/tutorial/stdlib2.html
- atexit --- 終了ハンドラー 11162
- atexit --- 終了ハンドラー atexit モジュールは、 終了ハンドラー を登録・解除する関数を定義します。 終了ハンドラーは、プログラムの正常終了時 (例えば sys.exit() が呼び出されたときや、メインモジュールの実行が完了したとき)、より一般的には interp
...ount = 0 def incrcounter ( n ): global _count _count = _count + n def savecounter (): with open ( 'counterfile' , 'w' ) as outfile : outfile . write ( ' %d ' % _count ) import atexit atexit . register ( savecounter ) register() に指定した位置引数とキーワ... - https://man.mtool.work/python/3.14/library/atexit.html
- プログラミング FAQ 10101
- プログラミング FAQ 一般的な質問 ブレークポイントやステップ実行ができる、ソースコードレベルのデバッガはありますか? はい。 Python 用のデバッガについては次に解説してあり、組み込みの breakpoint() 関数でそれらのデバッガに処理を移せます。 pdb モジ
...ラスはファイルのように振る舞いますが、書き込まれるデータをすべて大文字に変換します。 class UpperOut : def __init__ ( self , outfile ): self . _outfile = outfile def write ( self , s ): self . _outfile . write ( s . upper ()) def __getattr__ ( self , name...): return getattr ( self . _outfile , name ) ここで UpperOut クラスは write() メソッドを定義しなおして、引数の文字列を大文字に変換してから基礎となる self._out...file.write() メソッドを呼び出すようにします。その他すべてのメソッドは基礎となる self._outfile オブジェクトに移譲されます。この委譲は __getattr__() メソッドを通してなされます。属性の制御の詳細は 言語リファレンス を参照... - https://man.mtool.work/python/3.14/faq/programming.html
- trace --- Python 文実行のトレースと追跡 10101
- trace --- Python 文実行のトレースと追跡 ソースコード: Lib/trace.py trace モジュールを使うと、プログラムの実行をトレースし、各文のカバレッジを示す注釈付きリストを生成できます。 また、呼び出し元と呼び出し先の関係を表示したり、プログラムの実行
...e. Trace ( count = 1 , trace = 1 , countfuncs = 0 , countcallers = 0 , ignoremods = () , ignoredirs = () , infile = None , outfile = None , timing = False ) 文 (statement) や式 (expression) の実行をトレースするオブジェクトを作成します。 引数は全てオプシ...視するパッケージやモジュールを含むディレクトリのリストです。 infile は保存された集計 (count) 情報を読むファイルの名前です。 outfile は更新された集計 (count) 情報を書き出すファイルの名前です。 timing は、タイムスタンプをトレース開始時点からの相対秒数で表示... - https://man.mtool.work/python/3.14/library/trace.html
- json --- JSON エンコーダーとデコーダー 8502
- json --- JSON エンコーダーとデコーダー ソースコード: Lib/json/__init__.py JSON (JavaScript Object Notation) は、 RFC 7159 ( RFC 4627 を obsolete) と ECMA-404 によって定義された軽量のデータ交換用のフォーマットです。 JavaScript のオブジェクト
...検証して見やすく表示できます。 このインターフェースは json.tool サブモジュールが実装しています。 オプション引数の infile と outfile が指定されない場合、それぞれ sys.stdin と sys.stdout が使用されます。 $ echo '{"json": "obj"}' | python -m json { "json":...}, { "title": "Monty Python and the Holy Grail", "year": 1975 } ] infile が指定されない場合、 sys.stdin から読み込みます。 outfile infile の出力を outfile に書き込みます。そうでない場合、 sys.stdout に書き込みます。 --sort-keys 辞書の出力を、キーのアルフ... - https://man.mtool.work/python/3.14/library/json.html
- argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー 7980
- argparse --- コマンドラインオプションや引数、サブコマンド向けのパーサー Added in version 3.2. ソースコード: Lib/argparse.py 注釈 argparse は基本的なコマンドラインアプリケーションの実装に推奨される標準ライブラリのモジュールですが、動作を厳密
...>> parser = argparse . ArgumentParser () >>> parser . add_argument ( 'infile' , nargs = '?' ) >>> parser . add_argument ( 'outfile' , nargs = '?' ) >>> parser . parse_args ([ 'input.txt' , 'output.txt' ]) Namespace(infile='input.txt', outfile='output.tx...t') >>> parser . parse_args ([ 'input.txt' ]) Namespace(infile='input.txt', outfile=None) >>> parser . parse_args ([]) Namespace(infile=None, outfile=None) '*' -- すべてのコマンドライン引数がリストに集められ... - https://man.mtool.work/python/3.14/library/argparse.html
- optparse --- コマンドラインオプションのパーサー 7980
- optparse --- コマンドラインオプションのパーサー ソースコード: Lib/optparse.py 引数解析ライブラリの選択 標準ライブラリには、引数を解析するライブラリが三つあります。 getopt : C の手続き型の getopt API に忠実に対応するモジュールです。 optparse
...クリプトのユーザはコマンドライン上で例えば以下のような「よくある使い方」を実行できるようになります: < yourscript > -- file = outfile - q コマンドラインを解析すると、 optparse はユーザが指定した値に基づいて、 parse_args() が返す options オブジェクトの属性を...設定します。 このコマンドラインの解析を終えて parse_args() が戻った時点で、 options.filename は "outfile" 、 options.verbose は False になります。 optparse は長いオプションと短いオプションの両方に対応しており、短いオプションをま...オプションと引数を結び付けたりできます。 そのため、次のコマンドラインはどれも上の例と同じ意味になります。 < yourscript > - f outfile -- quiet < yourscript > -- quiet -- file outfile < yourscript > - q - foutfile < yourscript > - qfoutfile さらに、ユーザが... - https://man.mtool.work/python/3.14/library/optparse.html
- What's New In Python 3.1 7441
- What's New In Python 3.1 著者 : Raymond Hettinger この記事では Python 3.0 と比較した Python 3.1 の新機能を説明します。 Python 3.1 は 2009 年 6 月 27 日にリリースされました。 PEP 372: 順序付き辞書 通常の Python 辞書は、 key/value ペアを不定の
...で複数のコンテキストマネージャを使えるようになりました: >>> with open ( 'mylog.txt' ) as infile , open ( 'a.out' , 'w' ) as outfile : ... for line in infile : ... if '<critical>' in line : ... outfile . write ( line ) 新しい構文により contextlib.nested()... - https://man.mtool.work/python/3.14/whatsnew/3.1.html
- What's New In Python 3.2 5841
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...送出した際にそれらのファイナライズをとても上手く処理します。 with open ( 'mylog.txt' ) as infile , open ( 'a.out' , 'w' ) as outfile : for line in infile : if '<critical>' in line : outfile . write ( line ) (Georg Brandl と Mattias Brändström の貢献; apps... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
PREV
1
NEXT