Hi, Here is a function 'python-shell-send-block' to send a block to the python interpreter in python mode, it's similar to `python-shell-send-defun` but works on block. The implementation and testing are included in that patch. Please help review the changes. [PATCH] New function 'python-shell-send-block' for python-mode * lisp/progmodes/python.el: Add implemention of the function. * test/lisp/progmodes/python-tests.el: Test case for the function. * etc/NEWS: Document for the function. Best Regards Lin