babel: fixed bug in org-babel-expand-body:python
This commit is contained in:
parent
9ff31a5110
commit
0917218da5
|
@ -37,14 +37,14 @@
|
||||||
(add-to-list 'org-babel-tangle-langs '("python" "py" "#!/usr/bin/env python"))
|
(add-to-list 'org-babel-tangle-langs '("python" "py" "#!/usr/bin/env python"))
|
||||||
|
|
||||||
(defun org-babel-expand-body:python (body params &optional processed-params)
|
(defun org-babel-expand-body:python (body params &optional processed-params)
|
||||||
(let (vars (second (or processed-params (org-babel-process-params params))))
|
(concat
|
||||||
(concat
|
(mapconcat ;; define any variables
|
||||||
(mapconcat ;; define any variables
|
(lambda (pair)
|
||||||
(lambda (pair)
|
(format "%s=%s"
|
||||||
(format "%s=%s"
|
(car pair)
|
||||||
(car pair)
|
(org-babel-python-var-to-python (cdr pair))))
|
||||||
(org-babel-python-var-to-python (cdr pair))))
|
(second (or processed-params (org-babel-process-params params))) "\n")
|
||||||
vars "\n") "\n" (org-babel-trim body) "\n")))
|
"\n" (org-babel-trim body) "\n"))
|
||||||
|
|
||||||
(defun org-babel-execute:python (body params)
|
(defun org-babel-execute:python (body params)
|
||||||
"Execute a block of Python code with org-babel. This function is
|
"Execute a block of Python code with org-babel. This function is
|
||||||
|
|
Loading…
Reference in New Issue