I want to send the region to a python subprocess on stdin, using command
as the argument of python -c [command]
. Further I want to insert the result into the current buffer if I have called the function with a prefix argument.
Here's what I've tried:
(defun abcdef/python-region (prefix command &optional b e)
"Call python with `command' and send region on stdin.
Insert result if prefix present."
(interactive "Psr")
(call-process-region b e "python" prefix t "-c" command))
When I try calling it interactively with M-x abcdef/python-region
I get Wrong type argument: stringp, t
.
Related question here.