Function: python-shell-send-buffer
python-shell-send-buffer is an interactive and byte-compiled function
defined in python.el.gz.
Signature
(python-shell-send-buffer &optional SEND-MAIN MSG)
Documentation
Send the entire buffer to inferior Python process.
When optional argument SEND-MAIN is non-nil, allow execution of code inside blocks delimited by "if __name__== \\='__main__\\=':". When called interactively SEND-MAIN defaults to nil, unless it's called with prefix argument. When optional argument MSG is non-nil, forces display of a user-friendly message if there's no process running; defaults to t when called interactively.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell-send-buffer (&optional send-main msg)
"Send the entire buffer to inferior Python process.
When optional argument SEND-MAIN is non-nil, allow execution of
code inside blocks delimited by \"if __name__== \\='__main__\\=':\".
When called interactively SEND-MAIN defaults to nil, unless it's
called with prefix argument. When optional argument MSG is
non-nil, forces display of a user-friendly message if there's no
process running; defaults to t when called interactively."
(interactive (list current-prefix-arg t))
(save-restriction
(widen)
(python-shell-send-region (point-min) (point-max) send-main msg)))