I am trying to exit my python script with my custom message but it displays this below error also
Error:
SystemExit: You have entered [n/N/No] as you dont want to play !!!
/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2890: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
I want only to display this : SystemExit: You have entered [n/N/No] as you dont want to play !!!
and not /usr/local message
My code :
status = 'y'
if status == 'y':
print('Success')
else:
sys.exit("You have entered [n/N/No] as you dont want to play !!!")
I am sing python : Python 3.7.13