python-shell-send-buffer
python-shell-send-buffer is an interactive compiled Lisp function in `python.el
'.
(python-shell-send-buffer &optional SEND-MAIN)
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.