exit()
関数内から fromするのは悪い形ですか?
def respond_OK():
sys.stdout.write('action=OK\n\n')
sys.stdout.flush() # redundant when followed by exit()
sys.exit(0)
終了コードを設定して名前空間exit()
から ing するのではなく?__main__
def respond_OK():
global exit_status
sys.stdout.write('action=OK\n\n')
sys.stdout.flush()
exit_status = 0
sys.exit(exit_status)
機能の観点から見ると、違いはごくわずかですが、コンセンサスがどのような形になっているのか疑問に思っただけです. 他の人のコードで事前確率を見つけた場合、それを 2 回確認しますか?