Skip to content

Call `exit` from your Python console without parentheses ๐ŸŽ‰

License

Notifications You must be signed in to change notification settings

spenserblack/justexit.py

Repository files navigation

justexit.py

>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit

Do you get this often? I get this about once a day. It's a habit from Shell and Ruby that I just can't break. With this tool, you can call exit from your Python console and it will actually exit ๐ŸŽ‰

Installation

First, download justexit.py somewhere. Then, wherever you define environment variables (e.g. .bashrc), define the PYTHONSTARTUP variable to point to the path of justexit.py. For example:

# .bashrc
export PYTHONSTARTUP="$HOME/justexit.py"

Then, next time you're in an interactive Python console, you can just type exit and it will actually exit.

>>> exit

About

Call `exit` from your Python console without parentheses ๐ŸŽ‰

Topics

Resources

License

Stars

Watchers

Forks