Results of 1 - 10 of about 20 for pprint (0.008 sec.)
- pprint --- データの整形表示 15787
- pprint --- データの整形表示 ソースコード: Lib/pprint.py pprint モジュールは、任意の Python データ構造を、インタープリタへの入力に使える形式で「整形表示」する機能を提供します。 整形するデータ構造に Python の基本的な型以外のオブジェクトが含ま
...t サポートが追加されました。 バージョン 3.10 で変更: dataclasses.dataclass の pretty-print サポートが追加されました。 関数 pprint. pp ( object , stream = None , indent = 1 , width = 80 , depth = None , * , compact = False , sort_dicts = False , undersc...タの中で値を調査するために print() 関数の代わりに使用されることがあります。Tips: さらに、スコープ内で使用するために print = pprint.pp を再代入することができます)。 パラメータ : object -- 表示するオブジェクトです。 stream ( file-like object | None) -- wr...rueの場合、整数は _ で3桁区切りされて表示されます。そうでなければアンダースコアは表示されません(デフォルト)。 >>> import pprint >>> stuff = [ 'spam' , 'eggs' , 'lumberjack' , 'knights' , 'ni' ] >>> stuff . insert ( 0 , stuff ) >>> pprint . pp ( stuff... - https://man.mtool.work/python/3.14/library/pprint.html
- bisect --- 配列二分法アルゴリズム 8632
- bisect --- 配列二分法アルゴリズム ソースコード: Lib/bisect.py このモジュールは、挿入のたびにリストをソートすることなく、ソートされた順序でリストを維持するためのサポートを提供します。 コストのかかる比較演算を伴う長いリストの場合、これは線形検
...>>> from collections import namedtuple >>> from operator import attrgetter >>> from bisect import bisect , insort >>> from pprint import pprint >>> Movie = namedtuple ( 'Movie' , ( 'name' , 'released' , 'director' )) >>> movies = [ ... Movie ( 'Jaws' ,...ま映画を挿入する >>> romance = Movie ( 'Love Story' , 1970 , 'Hiller' ) >>> insort ( movies , romance , key = by_year ) >>> pprint ( movies ) [Movie(name='The Birds', released=1963, director='Hitchcock'), Movie(name='Love Story', released=1970, director... - https://man.mtool.work/python/3.14/library/bisect.html
- 11. 標準ライブラリをひとめぐり --- その II 8632
- 11. 標準ライブラリをひとめぐり --- その II ツアーの第2部では、プロフェッショナルプログラミングを支えるもっと高度なモジュールをカバーします。ここで挙げるモジュールは、小さなスクリプトの開発ではほとんど使いません。 11.1. 出力のフォーマット re
...>> import reprlib >>> reprlib . repr ( set ( 'supercalifragilisticexpialidocious' )) "{'a', 'c', 'd', 'e', 'f', 'g', ...}" pprint モジュールは、組み込みオブジェクトやユーザー定義オブジェクトをわかりやすく表示するための、より細かな制御手段を提供していま...す。 表示結果が複数行にわたる場合、「pretty printer」が改行やインデントを追加し、データ構造をより明確に示します。 >>> import pprint >>> t = [[[[ 'black' , 'cyan' ], 'white' , [ 'green' , 'red' ]], [[ 'magenta' , ... 'yellow' ], 'blue' ]]] ... >>> pprint.... pprint ( t , width = 30 ) [[[['black', 'cyan'], 'white', ['green', 'red']], [['magenta', 'yellow'], 'blue']]] textwrap モジュール... - https://man.mtool.work/python/3.14/tutorial/stdlib2.html
- What's New In Python 3.8 8564
- What's New In Python 3.8 編集者 : Raymond Hettinger この記事では Python 3.7 と比較した Python 3.8 の新機能を解説します。 Python 3.8 は 2019 年 10 月 14 日にリリースされました。 詳しくは 変更履歴 を参照してください。 概要 -- リリースハイライ
...され、NSKeyedArchiver でエンコードされたバイナリ plist の読み書きに対応しました。 (Contributed by Jon Janzen in bpo-26707 .) pprint pprint モジュールの複数の関数に sort_dicts パラメータが追加されました。 デフォルトでは、引き続き辞書を並べ替えてから文字列...を偽にすると、辞書はキーの挿入順を維持します。 デバッグ時に JSON 入力と比較する場合などに便利です。 さらに便利な新しい関数 pprint.pp() が追加されました。 pprint.pprint() と似ていますが、 sort_dicts のデフォルトは False です。 >>> from pprint import ppr...xt' ) >>> pp ( d , width = 40 ) # 元の順序 {'source': 'input.txt', 'operation': 'filter', 'destination': 'output.txt'} >>> pprint ( d , width = 40 ) # キーをアルファベット順に並べ替え {'destination': 'output.txt', 'operation': 'filter', 'source': 'inpu... - https://man.mtool.work/python/3.14/whatsnew/3.8.html
- What's New in Python 2.1 8479
- What's New in Python 2.1 著者 : A.M. Kuchling はじめに この記事はPython 2.1の新機能について説明します。Python 2.1には Python 2.0ほど多くの変更点はありませんが、楽しい驚きがあります。2.1はPythonの拡張計画(PEP)を使い動かす最初のリリースであ
.... L = [ 1 , 2 , 3 ] >>> L . append ( L ) >>> L # Python のデフォルトの出力を表示 [1, 2, 3, [...]] >>> # 表示用の関数として pprint.pprint() を使う ... import sys , pprint >>> sys . displayhook = pprint . pprint >>> L [1, 2, 3, <Recursion on list with id... - https://man.mtool.work/python/3.14/whatsnew/2.1.html
- pickle --- Python オブジェクトの直列化 8326
- pickle --- Python オブジェクトの直列化 ソースコード: Lib/pickle.py pickle モジュールは、Python オブジェクト構造を直列化・復元するためのバイナリプロトコルを実装しています。 pickle 化 (pickling) とは Python オブジェクトの階層をバイトストリーム
...None だとみなしてしまう。 raise pickle . UnpicklingError ( "unsupported persistent object" ) def main (): import io import pprint # データベースを初期化し、データを挿入する。 conn = sqlite3 . connect ( ":memory:" ) cursor = conn . cursor () cursor . ex...ckler を使ってレコードを保存する。 file = io . BytesIO () DBPickler ( file ) . dump ( memos ) print ( "Pickled records:" ) pprint . pprint ( memos ) # 試しにレコードを更新する。 cursor . execute ( "UPDATE memos SET task='learn italian' WHERE key=1" ) #...ームからレコードを読み込む。 file . seek ( 0 ) memos = DBUnpickler ( file , conn ) . load () print ( "Unpickled records:" ) pprint . pprint ( memos ) if __name__ == '__main__' : main () ディスパッチテーブル pickle 化に依存する他のコードの邪魔をせずに、一... - https://man.mtool.work/python/3.14/library/pickle.html
- データ型 8173
- データ型 この章で解説されるモジュールは日付や時間、型が固定された配列、ヒープキュー、両端キュー、列挙型のような種々の特殊なデータ型を提供します。 Python also provides some built-in data types, in particular, dict , list , set and frozenset
...標準的なインタプリタ型 追加のユーティリティクラスと関数 コルーチンユーティリティ関数 copy --- 浅いコピーおよび深いコピー操作 pprint --- データの整形表示 関数 PrettyPrinter オブジェクト 使用例 reprlib --- もう一つの repr() の実装 Reprオブジェクト Reprオブ... - https://man.mtool.work/python/3.14/library/datatypes.html
- difflib --- 差分の計算の補助 8173
- difflib --- 差分の計算の補助 ソースコード: Lib/difflib.py このモジュールはシーケンスを比較するクラスと関数を提供します。 その多くは、テキスト行のシーケンス (文字列のリストや ファイルオブジェクト など) を比較し、相違点を報告する 差分 (diff)
...ます: >>> result = list ( d . compare ( text1 , text2 )) result は文字列のリストなので、pretty-printしてみましょう: >>> from pprint import pprint >>> pprint ( result ) [' 1. Beautiful is better than ugly.\n', '- 2. Explicit is better than implicit.\n', '... - https://man.mtool.work/python/3.14/library/difflib.html
- Python ドキュメントの目次 8089
- Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列
...lthandler gc glob hashlib hmac IDLE と idelelib importlib.metadata inspect itertools linecache os os.path pathlib platform pprint py_compile pyclbr shelve statistics site socket ssl sqlite3 sys _thread threading traceback types typing unittest urllib.p...ib gc hashlib http IDLE と idelelib imaplib importlib inspect ipaddress math multiprocessing nntplib os pathlib pdb poplib pprint pydoc random signal smtplib socket time sys tracemalloc typing unicodedata venv xml 最適化 非推奨 削除 Python 3.9への移植...gzip IDLE と idelelib inspect io itertools json.tool logging math mmap multiprocessing os os.path pathlib pickle plistlib pprint py_compile shlex shutil socket ssl statistics sys tarfile threading tokenize tkinter time typing unicodedata unittest venv... - https://man.mtool.work/python/3.14/contents.html
- What's New In Python 3.10 8089
- What's New In Python 3.10 編集者 : Pablo Galindo Salgado この記事では Python 3.9 と比較した Python 3.10 の新機能を解説します。Python 3.10 は2021年10月4日にリリースされました。全詳細については 変更履歴 をご覧ください。 概要 -- リリースハイラ
...システムの識別情報を取得する platform.freedesktop_os_release() を追加しました。 (Christian Heimes による貢献、 bpo-28468 。) pprint pprint.pprint() に新しいキーワード引数 underscore_numbers を追加しました。 (sblondon による貢献、 bpo-42914 。) pprint が... - https://man.mtool.work/python/3.14/whatsnew/3.10.html