-2
ifでプログラムを終了するにはどうすればよいですか?Pythonでプログラムを終了する方法
#some code
if a == exit:
#here should be the program terminated not quit with program (can be with message)
else:
#the rest of the code
スクリプトを実行しているこれで
sys.exit()
はプログラムを終了使い方: はここでの例です。 スクリプトを終了するコマンドが必要です。