Skip to content

Instantly share code, notes, and snippets.

@egoag
egoag / async_subprocess.py
Last active September 13, 2017 09:45
Python asyncio subprocess
# *nix + python 3.6
import asyncio
import subprocess
async def _run(cmd, **kwargs):
process = await asyncio.create_subprocess_shell(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
**kwargs)