Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sethmlarson/fix-python-repl-exit
A simple script that makes typing `exit` in a Python interpreter do what you expect
https://github.com/sethmlarson/fix-python-repl-exit
exit interpreter python repl
Last synced: 12 days ago
JSON representation
A simple script that makes typing `exit` in a Python interpreter do what you expect
- Host: GitHub
- URL: https://github.com/sethmlarson/fix-python-repl-exit
- Owner: sethmlarson
- License: mit
- Created: 2020-04-11T18:22:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T21:17:29.000Z (almost 5 years ago)
- Last Synced: 2024-12-04T15:44:12.313Z (about 1 month ago)
- Topics: exit, interpreter, python, repl
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fix Python REPL `exit`
A simple script that makes typing `exit` in a Python interpreter do what you expect.
## How to Use
The whole script to make things work is in the file `fix-python-repl-exit.py`.
If you have a `PYTHONSTARTUP` script already, simply paste the contents of the file
into your existing script. If you don't have a script already then you can setup one
up like so:```bash
# Create the initial script
$ touch ~/.pythonstartup.py# Add the PYTHONSTARTUP environment variable to your bash / console profile:
# The name of the file '~/.bashrc' may be different if you're on a different OS.
$ echo 'export PYTHONSTARTUP="$HOME/.pythonstartup.py"' > ~/.bashrc# Add things to the '.pythonstartup.py' file:
$ cat fix-python-repl-exit.py >> ~/.pythonstartup.py# Try it out!
$ python
>>> exit
🎉
```## License
MIT