babel: treat python tuples as lists
This commit is contained in:
parent
a95c05773e
commit
fc693eb5e2
|
@ -91,10 +91,11 @@ specifying a var of the same value."
|
||||||
(format "%S" var)))
|
(format "%S" var)))
|
||||||
|
|
||||||
(defun org-babel-python-table-or-string (results)
|
(defun org-babel-python-table-or-string (results)
|
||||||
"If the results look like a table, then convert them into an
|
"If the results look like a list or tuple, then convert them into an
|
||||||
Emacs-lisp table, otherwise return the results as a string."
|
Emacs-lisp table, otherwise return the results as a string."
|
||||||
(org-babel-read
|
(org-babel-read
|
||||||
(if (string-match "^\\[.+\\]$" results)
|
(if (or (string-match "^\\[.+\\]$" results)
|
||||||
|
(string-match "^(.+)$" results))
|
||||||
(org-babel-read
|
(org-babel-read
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"\\[" "(" (replace-regexp-in-string
|
"\\[" "(" (replace-regexp-in-string
|
||||||
|
|
Loading…
Reference in New Issue