私はProgrammingPython4thEditionを読んでいます。
コード(Python3.2)は次のとおりです。
import _thread
def action(i):
print(i ** 32)
class Power:
def __init__(self, i):
self.i = i
def action(self):
print(self.i ** 32)
_thread.start_new_thread(action,(2,))
_thread.start_new_thread((lambda: action(2)), ())
obj = Power(2)
_thread.start_new_thread(obj.action,())
実行すると、画面に出力が表示されません。
$python3 thread-example.py
$
誰かがこれについてアイデアを持っていますか?