---
source: https://iinventedlight.com/library/notes/python-asyncio-subprocess.md
title: "Python asyncio subprocesses: create and manage child processes"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, Subprocesses; CPython, Subprocesses documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-asyncio-subprocess"
tags: [python, asyncio, subprocess, create_subprocess_exec, create_subprocess_shell]
client: Librarian
sources:
  - id: S1
    title: "Subprocesses"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/asyncio-subprocess.html
    accessed: 2026-11-26
    license: "PSF License Version 2"
  - id: S2
    title: "Subprocesses documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/asyncio-subprocess.rst
    accessed: 2026-11-26
    license: "PSF License Version 2"
---
# Python asyncio subprocesses: create and manage child processes
**Answer:** asyncio provides high-level async/await APIs to create and manage subprocesses.

## Creating a subprocess

create_subprocess_exec and create_subprocess_shell both return a Process instance.

Process is a high-level wrapper that allows communicating with subprocesses and watching for completion.

PIPE can be passed for stdin, stdout, or stderr.

DEVNULL means the corresponding stream uses the special file os.devnull.

## Platform notes and lifetime

On Windows, subprocesses are available when a ProactorEventLoop is used.

The Process class is not thread safe.

On POSIX systems, terminate sends SIGTERM to the child process.

On POSIX systems, kill sends SIGKILL to the child process.

## See also

- [python-asyncio-basics](https://iinventedlight.com/library/notes/python-asyncio-basics/)
- [python-subprocess](https://iinventedlight.com/library/notes/python-subprocess/)
- [python-asyncio-timeouts](https://iinventedlight.com/library/notes/python-asyncio-timeouts/)

## Claims

- id: C1
  claim: These APIs are high-level async/await helpers for subprocesses.
  source: S1
  evidence: "This section describes high-level async/await asyncio APIs to create and manage subprocesses."

- id: C2
  claim: Subprocesses on Windows need a ProactorEventLoop.
  source: S1
  evidence: "Subprocesses are available for Windows if a ProactorEventLoop is used."

- id: C3
  claim: The Process class is not thread safe.
  source: S2
  evidence: "This class is :ref:`not thread safe <asyncio-multithreading>`."

- id: C4
  claim: On POSIX systems, terminate sends SIGTERM to the child.
  source: S2
  evidence: "On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child process."

## Sources

- [S1] Subprocesses. Python Software Foundation. https://docs.python.org/3/library/asyncio-subprocess.html . License: PSF License Version 2. Accessed 2026-11-26.

- [S2] Subprocesses documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/asyncio-subprocess.rst . License: PSF License Version 2. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, Subprocesses; CPython, Subprocesses documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
