Saturday, January 14, 2012

How to disable annoying ipython exit prompt

ipython is an interactive Python shell which is generally great with its history and autocompletion, but has one annoying problem. Whenever you hit Ctrl-D to exit from ipython to bash, it asks you this question:

 
Do you really want to exit ([y]/n)?

Perhaps this prompt would be useful if I were using it to control an atomic power plant in emergency mode, but for my humble needs it's just annoying. It's easy to disable it - create a file called ~/.ipython/profile_default/ipython_config.py with the following content.

c = get_config()
c.InteractiveShell.confirm_exit = False

If you need a hand with Python, see what we can do for you.

No comments:

Post a Comment