Function: org-babel-python-send-string

org-babel-python-send-string is a byte-compiled function defined in ob-python.el.gz.

Signature

(org-babel-python-send-string SESSION BODY)

Documentation

Pass BODY to the Python process in SESSION.

Return output.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-python.el.gz
(defun org-babel-python-send-string (session body)
  "Pass BODY to the Python process in SESSION.
Return output."
  (org-babel-chomp
   (string-trim-right
    (org-babel-comint-with-output
        ((org-babel-session-buffer:python session)
         org-babel-python-eoe-indicator
         nil nil 'disable-prompt-filtering)
      (python-shell-send-string (format "\
try:
%s
except:
    raise
finally:
    print('%s')"
                                        (org-babel-python--shift-right body 4)
                                        org-babel-python-eoe-indicator)))
    (rx (literal org-babel-python-eoe-indicator) (zero-or-more anychar)))))