On this page
  1. asyncio.create_subprocess_shell
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

asyncio.create_subprocess_shell

Prev: asyncio.create_subprocess_exec | Up: asyncio | Next: asyncio.create_task
Rel: asyncio.AbstractEventLoop, asyncio.AbstractServer, asyncio.all_tasks, asyncio.as_completed
Ref: docs.python.org — asyncio.create_subprocess_shell
Tags: #public #python3 #stdlib #asyncio


Import

import asyncio
from asyncio import create_subprocess_shell

Signature & Overview

asyncio.create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, limit=65536, **kwds)

asyncio.create_subprocess_shell() function.

Usage

import asyncio

async def main():
    proc = await asyncio.create_subprocess_shell(
        "echo async-shell",
        stdout=asyncio.subprocess.PIPE,
    )
    out, _ = await proc.communicate()
    assert out.decode().strip() == "async-shell"

asyncio.run(main())

Gotchas

REPL Inspect

from asyncio import create_subprocess_shell
help(create_subprocess_shell)

Linked from

Related notes