Also add ppy and ipy aliases

- py alias should always preferably use ipython, however if it isn't
  available, it does fall back to the pure python interpreter.
- This is useful for running scripts since we would prefer ipython error
  output, but also for debugging, etc.
- However since py will use ipython, we didn't have any good way to get
  back to pure python unless it's typed in it's full form, which is too
  long. Because of this, this adds `ppy` alias, which always points to
  the pure python interpreter, no matter if ipython is available or not.
- This also adds a more explicit `ipy` alias, to clearly mark that we
  want ipython.
This commit is contained in:
ItsDrike 2021-12-18 03:15:38 +01:00
parent 6f613a1ea5
commit 754bbcbbd6
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843

View file

@ -89,8 +89,11 @@ for version in 2 3 3.6 3.7 3.8 3.9 3.10; do # Make aliases for py3.6,py3.7,...
fi
if command -v "ipython$version" > /dev/null; then
alias "py$version"="ipython$version"
alias "ipy$version"="ipython$version"
alias "ppy$version"="python$version"
else
alias "py$version"="python$version"
alias "ppy$version"="python$version"
fi
done