2016-07-25 Pythonのジェネレータ(関数) Python2 ジェネレータとは、retrun式で値を返すのではなく、yield式を呼ぶ関数。 def generator(): print('enter') yield print('exit')