Built-in functions — Python 3.15.2 documentation
The filename argument should give the file from which the code was read; pass some recognizable value if it wasn't read from a file ( '<string>' is commonly ...
The filename argument should give the file from which the code was read; pass some recognizable value if it wasn't read from a file ( '<string>' is commonly ...
This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed ...
Dictionaries are sometimes found in other languages as “associative memories” or “associative arrays”. Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type; strings and numbers can always be keys.
1 day ago · See also Module os Operating system interfaces, including functions to work with files at a lower level than Python file objects. Module io Python’s built-in I/O library, including both abstract classes and some concrete classes such as file I/O. Built-in function open () The standard way to open files for reading and writing with Python.
In particular, the output of float.hex() is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's %a ...
Python’s generators provide a convenient way to implement the iterator protocol. If a container object’s __iter__() method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the __iter__() and __next__() methods.
Source code: Lib ... Alternatively, consider searching an array of precomputed keys to locate the insertion point (as shown in the examples section below).
How do I find a module or application to perform task X?Where is the math.py (socket.py, regex.py, etc.) source file?Is there an equivalent to C’s onexit() in Python?
For example, on Windows systems using the FAT32 file systems, st_mtime ... locate the program file. When the environment is being replaced (using one ...
Below is a list of the types that are built into Python. Extension modules (written in C, Java, or other languages, depending on the implementation) can define additional types.
2 days ago · What’s New In Python 3.13 ¶ Editors: Adam Turner and Thomas Wouters This article explains the new features in Python 3.13, compared to 3.12. Python 3.13 was released on October 7, 2024. For full details, see the changelog.
Function objects also support getting and setting arbitrary attributes, which can be used, for example, to attach metadata to functions. Regular attribute dot- ...
1 day ago · Source code: Lib/glob.py The glob module finds pathnames using pattern matching rules similar to the Unix shell. No tilde expansion is done, but*,?, and character ranges expressed with[] will be co...
Why does Python use indentation for grouping of statements?, Why am I getting strange results with simple arithmetic operations?, Why are floating-point ...
1 day ago · Source code: Lib/io.py Overview: The io module provides Python’s main facilities for dealing with various types of I/O. There are three main types of I/O: text I/O, binary I/O and raw I/O. These ar...
The fields will be described in the order in which they occur in the structure. In addition to the following quick reference, the Examples section provides at-a ...