Fix Python – Disable IPython Exit Confirmation

Question

Asked By – Naftuli Kay

It’s really irritating that every time I type exit(), I get prompted with a confirmation to exit; of course I want to exit! Otherwise, I would not have written exit()!!!

Is there a way to override IPython’s default behaviour to make it exit without a prompt?

Now we will see solution for issue: Disable IPython Exit Confirmation


Answer

If you also want Ctrl-D to exit without confirmation, in IPython 0.11, add c.TerminalInteractiveShell.confirm_exit = False to your config file *.

If you don’t have a config file yet, run ipython profile create to create one.

Note this ticket if you’re working within the Django shell.


* The config file is located at: $HOME/.ipython/profile_default/ipython_config.py

This question is answered By – tuomassalo

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0