Python 标准库 Reference
查询 pathlib、json、csv、datetime、subprocess、os、re、itertools、collections 和 logging 常用写法。
文件路径、JSON 与 CSV
- pathlib.Path
- pathlib.exists
- pathlib.read_text
- pathlib.write_text
- pathlib.glob
- pathlib.mkdir
- pathlib.unlink
- pathlib.rename
- json.load
- json.loads
- json.dump
- json.dumps
- json.JSONDecodeError
- json.ensure_ascii
- json.object_hook
- json.indent
- csv.reader
- csv.DictReader
- csv.writer
- csv.DictWriter
- csv.dialect
- csv.delimiter
- csv.quotechar
- csv.Sniffer
日期时间、进程与系统
- datetime.datetime.now
- datetime.datetime.strptime
- datetime.datetime.strftime
- datetime.date.today
- datetime.timedelta
- datetime.timezone
- datetime.fromisoformat
- datetime.timestamp
- subprocess.run
- subprocess.Popen
- subprocess.check_output
- subprocess.CalledProcessError
- subprocess.timeout
- subprocess.capture_output
- subprocess.shell
- subprocess.cwd
- os.getcwd
- os.environ
- os.listdir
- os.makedirs
- os.remove
- os.rename
- os.walk
- os.path.join
正则、迭代工具与集合
- re.compile
- re.search
- re.match
- re.findall
- re.sub
- re.split
- re.groups
- re.flags
- itertools.count
- itertools.cycle
- itertools.repeat
- itertools.chain
- itertools.islice
- itertools.product
- itertools.combinations
- itertools.groupby
- collections.Counter
- collections.defaultdict
- collections.deque
- collections.namedtuple
- collections.OrderedDict
- collections.ChainMap
- collections.most_common
- collections.update
日志
- logging.getLogger
- logging.basicConfig
- logging.debug
- logging.info
- logging.warning
- logging.error
- logging.exception
- logging.FileHandler
相关内容
相关内容
- Python collections.ChainMap 参考 Python collections.ChainMap 参考,整理标准库调用语法、参数、示例、返回值和常见错误。
- Python collections.Counter 参考 Python collections.Counter 参考,整理标准库调用语法、参数、示例、返回值和常见错误。
- Python collections.defaultdict 参考 Python collections.defaultdict 参考,整理标准库调用语法、参数、示例、返回值和常见错误。
- Python collections.deque 参考 Python collections.deque 参考,整理标准库调用语法、参数、示例、返回值和常见错误。
- Python collections.most_common 参考 Python collections.most_common 参考,整理标准库调用语法、参数、示例、返回值和常见错误。
- Python collections.namedtuple 参考 Python collections.namedtuple 参考,整理标准库调用语法、参数、示例、返回值和常见错误。