import asyncio import sys async def main(): proc = await asyncio.create_subprocess_exec("echo", "Rémy", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) code = await proc.wait() out = await proc.stdout.read() sys.stdout.write(out.decode('utf-8')) err = await proc.stderr.read() sys.stderr.write(err.decode('utf-8')) return code if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: print("> Goodbye")