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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -