python - How to fix the menu selection for quiting -


so want run when number 7 entered should quit current program. have tried rest of menu selection want fix quit @ moment.

if menu_selection == "7":     quit() 

i assuming guessing quit() way exit. should try sys.exit():

 import sys  # @ head of program   ...  program  ...  if menu_selection == "7":      sys.exit() 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -