回答編集履歴
1
変数名変えた
answer
CHANGED
@@ -4,16 +4,16 @@
|
|
4
4
|
import time
|
5
5
|
from threading import Thread
|
6
6
|
|
7
|
-
|
7
|
+
cond = True
|
8
8
|
|
9
9
|
def f():
|
10
|
-
global
|
10
|
+
global cond
|
11
11
|
time.sleep(1)
|
12
|
-
|
12
|
+
cond = False
|
13
13
|
|
14
14
|
thread = Thread(target=f)
|
15
15
|
thread.start()
|
16
|
-
while
|
16
|
+
while cond:
|
17
17
|
print("hoge")
|
18
18
|
time.sleep(0.2)
|
19
19
|
```
|