From 7c6e2e705f3bb3b0264fbe8469dcf6160ce07f4a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 6 Oct 2018 00:24:44 -0400 Subject: [PATCH] lang/python: add Ipython/Jupyter REPL commands --- modules/lang/python/autoload/python.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/lang/python/autoload/python.el b/modules/lang/python/autoload/python.el index ab9733d40..73072dc83 100644 --- a/modules/lang/python/autoload/python.el +++ b/modules/lang/python/autoload/python.el @@ -22,6 +22,23 @@ (run-python nil t t)) (run-python nil t t))))) +;;;###autoload +(defun +python/open-ipython-repl () + "Open an IPython REPL." + (interactive) + (let ((python-shell-interpreter "ipython") + (python-shell-interpreter-args "-i --pylab --simple-prompt --no-color-info")) + (+python/repl))) + +;;;###autoload +(defun +python/open-jupyter-repl () + "Open a Jupyter console." + (interactive) + (add-to-list 'python-shell-completion-native-disabled-interpreters "jupyter") + (let ((python-shell-interpreter "jupyter") + (python-shell-interpreter-args "console --simple-prompt")) + (+python/repl))) + (defun +python--extract-version (prefix str) (when str (format "%s%s" prefix (cadr (split-string str " ")))))