Created
November 26, 2021 13:21
-
-
Save laixintao/77b751b0a59d87cfbadf387637db561d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def subshell(): | |
print("start sleep...") | |
process = await asyncio.create_subprocess_shell( | |
"sleep 23", | |
) | |
print("sub process create, my id {}".format(process, process.pid)) | |
await asyncio.sleep(23) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(subshell()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Linux: