From: "Doyley, Marvin M." <mdoyley@ur.rochester.edu>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: strange behavior with org-babel python
Date: Tue, 12 May 2015 01:07:25 +0000 [thread overview]
Message-ID: <801AAE40-718A-46D4-A16D-5A0BEDB510ED@ur.rochester.edu> (raw)
Hi there,
If run the follow codes I get the following, could someone explain to me what is going wrong
(1) The desired results
#+BEGIN_SRC python :results output :exports both :session
x=5
def foo(x):
if x>0:
return x+1
else:
return x-1
print(foo(x))
#+END_SRC
#+RESULTS:
: 6
(2) No results
#+BEGIN_SRC python :results output raw :exports both
x=5
if x>0:
x= x+1
else:
x= x-1
print(x)
#+END_SRC
#+RESULTS:
(3) Not sure, why I get this error
#+BEGIN_SRC python :results output raw :exports both :session
x=5
if x>0:
x= x+1
else:
x= x-1
print(x)
#+END_SRC
#+RESULTS:
>>> >>> >>> >>> ... ... File "<ipython-input-5-f6e13edbe7ef>", line 3
else:
^
IndentationError: unindent does not match any outer indentation level
If you want to paste code into IPython, try the %paste and %cpaste magic functions.
Thanks,
M
PS in .emacs, I have (setq org-babel-python-command "ipython --no-banner --classic --no-confirm-exit")
next reply other threads:[~2015-05-12 2:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 1:07 Doyley, Marvin M. [this message]
2015-05-12 3:20 ` strange behavior with org-babel python Puneeth Chaganti
2015-05-12 9:10 ` Doyley, Marvin M.
2015-05-13 17:49 ` Puneeth Chaganti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=801AAE40-718A-46D4-A16D-5A0BEDB510ED@ur.rochester.edu \
--to=mdoyley@ur.rochester.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).