From ceab2c49e62052c196cae7ccbe0b6ca7005ef235 Mon Sep 17 00:00:00 2001 From: TheK4n Date: Fri, 28 Oct 2022 22:33:00 +0300 Subject: [PATCH] ref func: py --- sub/bash/functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sub/bash/functions b/sub/bash/functions index 1c4176c..2e1aa0b 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -152,7 +152,11 @@ docker_ips() { py() { - test -z "$@" && ipython -i -c "q = exit" || python3 $@ + if [ -z "$@" -a -n "$(which ipython)" ]; then + ipython -i -c "q = exit" + else + python3 $@ + fi }