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 ...
Source code: Lib/re/ This module provides regular expression matching operations similar to those found in Perl. Both patterns and strings to be searched ...
Split the string into a list, splitting it wherever the RE matches. sub(). Find all substrings where the RE matches, and replace them with a different string.
source must be either a string or a code object. If ... This is an advanced function that is not needed in everyday Python programming, unlike importlib.
Python HOWTOs In-depth topic manuals. Installing Python modules Third-party modules and PyPI.org. Extending and embedding For C/C++ programmers.
Once you've written some code that works with Unicode data, the next problem is input/output. How do you get Unicode strings into your program, and how do you ...
This may be a string or a tuple of several items of information (e.g., an error code and a string explaining the code). ... program that triggered the error.
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'.
15 hours ago · Source code: Lib/textwrap.py The textwrap module provides some convenience functions, as well as TextWrapper, the class that does all the work. If you’re just wrapping or filling one or two text st...
Source code: Lib/pdb.py The module pdb defines an interactive source code debugger for Python programs. It supports setting (conditional) breakpoints and ...
15 hours ago · The shlex class makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell. This will often be useful for writing minilanguages, (for example, in run control files for Python applications) or for parsing quoted strings. The shlex module defines the following functions: shlex.split(s, comments=False, posix=True) ¶ Split the string s using shell-like syntax ...
You can use the “Copy” button (it appears in the upper-right corner when hovering over or tapping a code example), which strips prompts and omits output, to ...