> **Источник:** https://python-all.ru/3/library/allos.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# Службы операционной системы общего назначения

Модули, описанные в этой главе, предоставляют интерфейсы к возможностям операционной системы, доступным (почти) во всех ОС, таким как файлы и часы. Интерфейсы в основном смоделированы по образцу Unix- или C-интерфейсов, но они также доступны и в большинстве других систем. Вот обзор:

- [`os` – различные интерфейсы операционной системы](https://python-all.ru/3/library/os.html)

  - [Имена файлов, аргументы командной строки и переменные окружения](https://python-all.ru/3/library/os.html#file-names-command-line-arguments-and-environment-variables)
  - [Режим UTF-8 в Python](https://python-all.ru/3/library/os.html#python-utf-8-mode)
  - [Параметры процесса](https://python-all.ru/3/library/os.html#process-parameters)
  - [Создание файловых объектов](https://python-all.ru/3/library/os.html#file-object-creation)
  - [Операции с файловыми дескрипторами](https://python-all.ru/3/library/os.html#file-descriptor-operations)

    - [Определение размера терминала](https://python-all.ru/3/library/os.html#querying-the-size-of-a-terminal)
    - [Наследование файловых дескрипторов](https://python-all.ru/3/library/os.html#inheritance-of-file-descriptors)
  - [Файлы и каталоги](https://python-all.ru/3/library/os.html#files-and-directories)

    - [Файловые дескрипторы таймера](https://python-all.ru/3/library/os.html#timer-file-descriptors)
    - [Расширенные атрибуты Linux](https://python-all.ru/3/library/os.html#linux-extended-attributes)
  - [Управление процессами](https://python-all.ru/3/library/os.html#process-management)
  - [Интерфейс к планировщику](https://python-all.ru/3/library/os.html#interface-to-the-scheduler)
  - [Различная системная информация](https://python-all.ru/3/library/os.html#miscellaneous-system-information)
  - [Случайные числа](https://python-all.ru/3/library/os.html#random-numbers)
- [`io` – Основные инструменты для работы с потоками данных](https://python-all.ru/3/library/io.html)

  - [Обзор](https://python-all.ru/3/library/io.html#overview)

    - [Текстовый ввод/вывод](https://python-all.ru/3/library/io.html#text-i-o)
    - [Двоичный ввод/вывод](https://python-all.ru/3/library/io.html#binary-i-o)
    - [Необработанный ввод/вывод](https://python-all.ru/3/library/io.html#raw-i-o)
  - [Кодировка текста](https://python-all.ru/3/library/io.html#text-encoding)

    - [Добровольное предупреждение о кодировке](https://python-all.ru/3/library/io.html#opt-in-encodingwarning)
  - [Интерфейс модуля высокого уровня](https://python-all.ru/3/library/io.html#high-level-module-interface)
  - [Иерархия классов](https://python-all.ru/3/library/io.html#class-hierarchy)

    - [Базовые классы ввода/вывода](https://python-all.ru/3/library/io.html#i-o-base-classes)
    - [Необработанный файловый ввод/вывод](https://python-all.ru/3/library/io.html#raw-file-i-o)
    - [Буферизированные потоки](https://python-all.ru/3/library/io.html#buffered-streams)
    - [Текстовый ввод/вывод](https://python-all.ru/3/library/io.html#id1)
  - [Статическая типизация](https://python-all.ru/3/library/io.html#static-typing)
  - [Производительность](https://python-all.ru/3/library/io.html#performance)

    - [Двоичный ввод/вывод](https://python-all.ru/3/library/io.html#id2)
    - [Текстовый ввод/вывод](https://python-all.ru/3/library/io.html#id3)
    - [Многопоточность](https://python-all.ru/3/library/io.html#multi-threading)
    - [Реентерабельность](https://python-all.ru/3/library/io.html#reentrancy)
- [`time` – Доступ ко времени и преобразования](https://python-all.ru/3/library/time.html)

  - [Функции](https://python-all.ru/3/library/time.html#functions)
  - [Константы идентификаторов часов](https://python-all.ru/3/library/time.html#clock-id-constants)
  - [Константы часовых поясов](https://python-all.ru/3/library/time.html#timezone-constants)
- [`logging` – Средство журналирования для Python](https://python-all.ru/3/library/logging.html)

  - [Объекты Logger](https://python-all.ru/3/library/logging.html#logger-objects)
  - [Уровни журналирования](https://python-all.ru/3/library/logging.html#logging-levels)
  - [Объекты-обработчики](https://python-all.ru/3/library/logging.html#handler-objects)
  - [Объекты-форматировщики](https://python-all.ru/3/library/logging.html#formatter-objects)
  - [Объекты-фильтры](https://python-all.ru/3/library/logging.html#filter-objects)
  - [Объекты LogRecord](https://python-all.ru/3/library/logging.html#logrecord-objects)
  - [Атрибуты LogRecord](https://python-all.ru/3/library/logging.html#logrecord-attributes)
  - [Объекты LoggerAdapter](https://python-all.ru/3/library/logging.html#loggeradapter-objects)
  - [Потокобезопасность](https://python-all.ru/3/library/logging.html#thread-safety)
  - [Функции уровня модуля](https://python-all.ru/3/library/logging.html#module-level-functions)
  - [Атрибуты уровня модуля](https://python-all.ru/3/library/logging.html#module-level-attributes)
  - [Интеграция с модулем warnings](https://python-all.ru/3/library/logging.html#integration-with-the-warnings-module)
- [`logging.config` – Конфигурация логирования](https://python-all.ru/3/library/logging.config.html)

  - [Функции конфигурации](https://python-all.ru/3/library/logging.config.html#configuration-functions)
  - [Вопросы безопасности](https://python-all.ru/3/library/logging.config.html#security-considerations)
  - [Схема конфигурационного словаря](https://python-all.ru/3/library/logging.config.html#configuration-dictionary-schema)

    - [Подробности схемы словаря](https://python-all.ru/3/library/logging.config.html#dictionary-schema-details)
    - [Инкрементальная конфигурация](https://python-all.ru/3/library/logging.config.html#incremental-configuration)
    - [Соединения объектов](https://python-all.ru/3/library/logging.config.html#object-connections)
    - [Пользовательские объекты](https://python-all.ru/3/library/logging.config.html#user-defined-objects)
    - [Порядок конфигурации обработчиков](https://python-all.ru/3/library/logging.config.html#handler-configuration-order)
    - [Доступ к внешним объектам](https://python-all.ru/3/library/logging.config.html#access-to-external-objects)
    - [Доступ к внутренним объектам](https://python-all.ru/3/library/logging.config.html#access-to-internal-objects)
    - [Разрешение импорта и пользовательские импортеры](https://python-all.ru/3/library/logging.config.html#import-resolution-and-custom-importers)
    - [Настройка QueueHandler и QueueListener](https://python-all.ru/3/library/logging.config.html#configuring-queuehandler-and-queuelistener)
  - [Формат файла конфигурации](https://python-all.ru/3/library/logging.config.html#configuration-file-format)
- [`logging.handlers` – Обработчики логирования](https://python-all.ru/3/library/logging.handlers.html)

  - [StreamHandler](https://python-all.ru/3/library/logging.handlers.html#streamhandler)
  - [FileHandler](https://python-all.ru/3/library/logging.handlers.html#filehandler)
  - [NullHandler](https://python-all.ru/3/library/logging.handlers.html#nullhandler)
  - [WatchedFileHandler](https://python-all.ru/3/library/logging.handlers.html#watchedfilehandler)
  - [BaseRotatingHandler](https://python-all.ru/3/library/logging.handlers.html#baserotatinghandler)
  - [RotatingFileHandler](https://python-all.ru/3/library/logging.handlers.html#rotatingfilehandler)
  - [TimedRotatingFileHandler](https://python-all.ru/3/library/logging.handlers.html#timedrotatingfilehandler)
  - [SocketHandler](https://python-all.ru/3/library/logging.handlers.html#sockethandler)
  - [DatagramHandler](https://python-all.ru/3/library/logging.handlers.html#datagramhandler)
  - [SysLogHandler](https://python-all.ru/3/library/logging.handlers.html#sysloghandler)
  - [NTEventLogHandler](https://python-all.ru/3/library/logging.handlers.html#nteventloghandler)
  - [SMTPHandler](https://python-all.ru/3/library/logging.handlers.html#smtphandler)
  - [MemoryHandler](https://python-all.ru/3/library/logging.handlers.html#memoryhandler)
  - [HTTPHandler](https://python-all.ru/3/library/logging.handlers.html#httphandler)
  - [QueueHandler](https://python-all.ru/3/library/logging.handlers.html#queuehandler)
  - [QueueListener](https://python-all.ru/3/library/logging.handlers.html#queuelistener)
- [`platform` – Доступ к идентифицирующим данным базовой платформы](https://python-all.ru/3/library/platform.html)

  - [Кроссплатформенный](https://python-all.ru/3/library/platform.html#cross-platform)
  - [Платформа Java](https://python-all.ru/3/library/platform.html#java-platform)
  - [Платформа Windows](https://python-all.ru/3/library/platform.html#windows-platform)
  - [Платформа macOS](https://python-all.ru/3/library/platform.html#macos-platform)
  - [Платформа iOS](https://python-all.ru/3/library/platform.html#ios-platform)
  - [Платформы Unix](https://python-all.ru/3/library/platform.html#unix-platforms)
  - [Платформы Linux](https://python-all.ru/3/library/platform.html#linux-platforms)
  - [Платформа Android](https://python-all.ru/3/library/platform.html#android-platform)
  - [Использование командной строки](https://python-all.ru/3/library/platform.html#command-line-usage)
- [`errno` – Стандартные системные символы errno](https://python-all.ru/3/library/errno.html)
- [`ctypes` – Библиотека внешних функций для Python](https://python-all.ru/3/library/ctypes.html)

  - [Руководство по ctypes](https://python-all.ru/3/library/ctypes.html#ctypes-tutorial)

    - [Загрузка библиотек динамической компоновки](https://python-all.ru/3/library/ctypes.html#loading-dynamic-link-libraries)
    - [Доступ к функциям из загруженных DLL](https://python-all.ru/3/library/ctypes.html#accessing-functions-from-loaded-dlls)
    - [Вызов функций](https://python-all.ru/3/library/ctypes.html#calling-functions)
    - [Базовые типы данных](https://python-all.ru/3/library/ctypes.html#fundamental-data-types)
    - [Вызов функций (продолжение)](https://python-all.ru/3/library/ctypes.html#calling-functions-continued)
    - [Вызов функций с переменным числом аргументов](https://python-all.ru/3/library/ctypes.html#calling-variadic-functions)
    - [Вызов функций с собственными пользовательскими типами данных](https://python-all.ru/3/library/ctypes.html#calling-functions-with-your-own-custom-data-types)
    - [Указание требуемых типов аргументов (прототипы функций)](https://python-all.ru/3/library/ctypes.html#specifying-the-required-argument-types-function-prototypes)
    - [Типы возвращаемых значений](https://python-all.ru/3/library/ctypes.html#return-types)
    - [Передача указателей (или передача параметров по ссылке)](https://python-all.ru/3/library/ctypes.html#passing-pointers-or-passing-parameters-by-reference)
    - [Структуры и объединения](https://python-all.ru/3/library/ctypes.html#structures-and-unions)
    - [Размещение структур/объединений, выравнивание и порядок байт](https://python-all.ru/3/library/ctypes.html#structure-union-layout-alignment-and-byte-order)
    - [Битовые поля в структурах и объединениях](https://python-all.ru/3/library/ctypes.html#bit-fields-in-structures-and-unions)
    - [Массивы](https://python-all.ru/3/library/ctypes.html#arrays)
    - [Указатели](https://python-all.ru/3/library/ctypes.html#pointers)
    - [Потокобезопасность без GIL](https://python-all.ru/3/library/ctypes.html#thread-safety-without-the-gil)
    - [Преобразования типов](https://python-all.ru/3/library/ctypes.html#type-conversions)
    - [Неполные типы](https://python-all.ru/3/library/ctypes.html#incomplete-types)
    - [Функции обратного вызова](https://python-all.ru/3/library/ctypes.html#callback-functions)
    - [Доступ к значениям, экспортируемым из DLL](https://python-all.ru/3/library/ctypes.html#accessing-values-exported-from-dlls)
    - [Неожиданности](https://python-all.ru/3/library/ctypes.html#surprises)
    - [Типы данных переменного размера](https://python-all.ru/3/library/ctypes.html#variable-sized-data-types)
  - [Справочник по ctypes](https://python-all.ru/3/library/ctypes.html#ctypes-reference)

    - [Поиск общих библиотек](https://python-all.ru/3/library/ctypes.html#finding-shared-libraries)
    - [Вывод загруженных общих библиотек](https://python-all.ru/3/library/ctypes.html#listing-loaded-shared-libraries)
    - [Загрузка общих библиотек](https://python-all.ru/3/library/ctypes.html#loading-shared-libraries)
    - [Внешние функции](https://python-all.ru/3/library/ctypes.html#foreign-functions)
    - [Прототипы функций](https://python-all.ru/3/library/ctypes.html#function-prototypes)
    - [Вспомогательные функции](https://python-all.ru/3/library/ctypes.html#utility-functions)
    - [Типы данных](https://python-all.ru/3/library/ctypes.html#data-types)
    - [Базовые типы данных](https://python-all.ru/3/library/ctypes.html#ctypes-fundamental-data-types-2)
    - [Структурированные типы данных](https://python-all.ru/3/library/ctypes.html#structured-data-types)
    - [Массивы и указатели](https://python-all.ru/3/library/ctypes.html#arrays-and-pointers)
    - [Исключения](https://python-all.ru/3/library/ctypes.html#exceptions)
