
json — JSON encoder and decoder — Python 3.13.2 documentation
2 天之前 · json. load (fp, *, cls = None, object_hook = None, parse_float = None, parse_int = None, parse_constant = None, object_pairs_hook = None, ** kw) ¶ Deserialize fp to a Python object using the JSON-to-Python conversion table. Parameters: fp (file-like object) – A .read()-supporting text file or binary file containing the JSON document to be ...
18.2. json --- JSON エンコーダおよびデコーダ - Python
>>> import json >>> json. loads ('["foo", {"bar":["baz", null, 1.0, 2]}]') [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] >>> json. loads ('" \\ "foo \\ bar"') u'"foo\x08ar' >>> from StringIO import StringIO >>> io = StringIO ('["streaming API"]') >>> json. load (io) [u'streaming API']
Internet Data Handling — Python 3.13.2 documentation
4 天之前 · json — JSON encoder and decoder. Basic Usage; Encoders and Decoders; Exceptions; Standard Compliance and Interoperability. Character Encodings; Infinite and NaN Number Values; Repeated Names Within an Object; Top-level Non-Object, Non-Array Values; Implementation Limitations; Command Line Interface. Command line options; mailbox ...
pickle — Python object serialization — Python 3.13.2 documentation
2 天之前 · The json module: a standard library module allowing JSON serialization and deserialization. Data stream format ¶ The data format used by pickle is Python-specific.
The Python Standard Library — Python 3.9.21 documentation
2021年3月9日 · While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It also describes some of the optional components that are commonly included in Python distributions.
pprint — Data pretty printer — Python 3.13.2 documentation
2 天之前 · >>> import json >>> import pprint >>> from urllib.request import urlopen >>> with urlopen ('https://pypi.org/pypi/sampleproject/1.2.0/json') as resp:... project_info = json . load ( resp )[ 'info' ] In its basic form, pp() shows the whole object:
marshal — Internal Python object serialization — Python 3.13.2 ...
5 天之前 · This module contains functions that can read and write Python values in a binary format. The format is specific to Python, but independent of machine architecture issues (e.g., you can write a Python value to a file on a PC, transport the file to a Mac, and read it back there).
copy — Shallow and deep copy operations — Python 3.13.2 …
2 天之前 · Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy is sometimes needed so one can change one copy without changing the other.
configparser — Configuration file parser — Python 3.13.2 …
2 天之前 · Module json. The json module implements a subset of JavaScript syntax which is sometimes used for configuration, but does not support comments.
re — Regular expression operations — Python 3.13.2 documentation
2 天之前 · The third-party regex module, which has an API compatible with the standard library re module, but offers additional functionality and a more thorough Unicode support.