About 312 results
Open links in new tab
  1. 7. Input and Output — Python 3.13.3 documentation

    2 days ago · Often you’ll want more control over the formatting of your output than simply printing space-separated values. There are several ways to format output. To use formatted string literals, begin a string with f or F before the opening quotation mark or triple quotation mark.

  2. pprint — Data pretty printer — Python 3.13.3 documentation

    2 days ago · The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter. If the formatted structures include objects which are not fundamental Python types, the representation may not be loadable.

  3. string — Common string operations — Python 3.13.3 …

    2 days ago · The format_spec field contains a specification of how the value should be presented, including such details as field width, alignment, padding, decimal precision and so on. Each value type can define its own “formatting mini-language” or interpretation of the format_spec.

  4. 28.10. traceback — 打印或检索堆栈回溯 — Python 2.7.18 文档

    traceback.format_exception (etype, value, tb [, limit]) ¶ Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to print_exception(). The return value is a list of strings, each ending in a newline and some containing internal newlines.

  5. traceback — Print or retrieve a stack traceback — Python 3.13.3 ...

    1 day ago · This module provides a standard interface to extract, format and print stack traces of Python programs. It is more flexible than the interpreter’s default traceback display, and therefore makes it possible to configure certain aspects of the output.

  6. formatter — Generic output formatting — Python 3.8.20 …

    Mar 8, 2020 · Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor any sort of «change back» operation.

  7. locale — Internationalization services — Python 3.13.3 …

    2 days ago · locale. format_string (format, val, grouping = False, monetary = False) ¶ Formats a number val according to the current LC_NUMERIC setting. The format follows the conventions of the % operator.

  8. Logging Cookbook — Python 3.13.3 documentation

    When logging was added to the Python standard library, the only way of formatting messages with variable content was to use the %-formatting method. Since then, Python has gained two new formatting approaches: string.Template (added in Python …

  9. datetime — Basic date and time types — Python 3.13.3 …

    This makes it possible to specify a format string for a datetime object in formatted string literals and when using str.format(). See also strftime() and strptime() Behavior and datetime.isoformat() .

  10. textwrap — Text wrapping and filling — Python 3.13.3 …

    2 days ago · >>> print (indent (s, '+ ', lambda line: True)) + hello + + + world Added in version 3.3. wrap() , fill() and shorten() work by creating a TextWrapper instance and calling a single method on it.

Refresh