teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

修正

2019/02/06 06:30

投稿

sequelanonymous
sequelanonymous

スコア123

title CHANGED
File without changes
body CHANGED
@@ -7,7 +7,7 @@
7
7
  bash-3.2$ cat test.py
8
8
  import os
9
9
 
10
- if os.fork():
10
+ if os.fork(): #os.fork()が実行されると0が返却され、子プロセスはelse内の処理に入りprint文を実行する
11
11
  print(f'親プロセス: {os.getpid()}')
12
12
  else:
13
13
  print(f'子プロセス: {os.getpid()}')