python-shell-send-region
python-shell-send-region is an interactive compiled Lisp function in `python.el
'.
(python-shell-send-region START END &optional SEND-MAIN)
Send the region delimited by START and END 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.