string — Common string operations — Python 3.15.2 documentation
Source code: Lib/string/__init__.py String constants: The constants defined in this module are: Custom string formatting: The built-in string class provides ...
Source code: Lib/string/__init__.py String constants: The constants defined in this module are: Custom string formatting: The built-in string class provides ...
Text Sequence Type — str ¶. Textual data in Python is handled with str objects, or strings. Strings are immutable sequences of Unicode code points. String literals are written in a variety of ways: Single quotes: 'allows embedded "double" quotes'.
If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). If it is a code object, it is ...
1 day ago · Regular expression HOWTO ¶ Abstract This document is an introductory tutorial to using regular expressions in Python with the re module. It provides a gentler introduction than the corresponding section in the Library Reference. Introduction ¶ Regular expressions (called REs, or regexes, or regex patterns) are essentially a tiny, highly specialized programming language embedded inside Python ...
... string of length 1 that contains the corresponding code point. The reverse ... The surrogateescape error handler will decode any non-ASCII bytes as code ...
Otherwise these codecs treat the presence of surrogate code point in str as an error. ... Implements the 'replace' error handling. Substitutes ? (ASCII ...
For example, here is an excerpt from code in the collections module: ... command fails (replace X.Y with the Python version). On the other hand, pkg ...
16 hours ago · Text Processing Services ¶ The modules described in this chapter provide a wide range of string manipulation operations and other text processing services. The codecs module described under Binary Data Services is also highly relevant to text processing. In addition, see the documentation for Python’s built-in string type in Text Sequence Type — str.
The library changes include a new profiling package with Tachyon, a high-frequency statistical sampling profiler, more color in command-line output, as well as ...
1 day ago · The string printed as the exception type is the name of the built-in exception that occurred. This is true for all built-in exceptions, but need not be true for user-defined exceptions (although it is a useful convention).
Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see ...