io — Core tools for working with streams — Python 3.9.25 documentation

docs.python.org

Tin mới

os — Miscellaneous operating system interfaces

time — Time access and conversions

Python documentation for the current stable release

Python documentation for the current stable release

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 are generic categories, and various backing stores can be

Python Module Index

3.9.25 Documentation

The Python Standard Library

Generic Operating System Services

bytes-like objects

Binary I/O (also called buffered I/O) expects bytes-like objects and produces bytes objects. No encoding, decoding, or newline translation is performed. This category of streams can be used for all kinds of non-text data

socket.socket.makefile()

Binary I/O (also called buffered I/O) expects bytes-like objects and produces bytes objects. No encoding, decoding, or newline translation is performed. This category of streams can be used for all kinds of non-text data

PyFile_SetOpenCodeHook()

Opens the provided file with mode 'rb'. This function should be used when the intent is to treat the contents as executable code.

sys: Access system-specific parameters and functions.

contains the standard IO streams: sys.stdin, sys.stdout, and sys.stderr.

locale.getpreferredencoding(False)

A buffered text stream providing higher-level access to a BufferedIOBase buffered binary stream. It inherits TextIOBase.

codecs.register_error()

A buffered text stream providing higher-level access to a BufferedIOBase buffered binary stream. It inherits TextIOBase.

signal: Set handlers for asynchronous events.

Binary buffered objects (instances of BufferedReader, BufferedWriter, BufferedRandom and BufferedRWPair) are not reentrant. While reentrant calls will not happen in normal situations, they can arise from doing I/O in a s