Last active
May 15, 2022 12:23
-
-
Save hnw/75fa5783758d80139bd7bf7312ddc112 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 time | |
import subprocess | |
def call_popen(): | |
subprocess.Popen(["sleep", "10"]); | |
def main(): | |
print(1) | |
call_popen() # 即座に戻ってくる | |
print(2) | |
time.sleep(5) | |
# プロセス終了後も子プロセスは走り続ける、親プロセスはPID1になる | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment