emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] python source block weirdness


From: Brad Knotwell
Subject: [O] python source block weirdness
Date: Sat, 30 Mar 2019 18:39:50 +0000 (UTC)

Good day all--

I've been reading on the mailing list and web about this but it's entirely unclear to me what I need to do to make this work.  I have a minimal example below to show what I'm fighting.

The raw/generated documents below show the problem clearly as the second block doesn't run correctly.  Looking in the session, it receives an "unexpected indent" error which is unreasonable as I can paste that code into Python's REPL and get an expected result.

Looking around a bit, people were seeing this 4-5 years ago but I haven't been able to find anything since.  Relevant version info:  9.2 orgmode, High Sierra OSX, and 2.7.10 Python.

Thx.

--Brad

#+NAME: works
#+begin_src python :session broken :exports both
s = 3
t = 4
'result = %d' % (s + t)
#+end_src

Working result below:
#+RESULTS: works


#+NAME: surprise
#+begin_src python :session broken :exports both
try:
    'hi'
except:
    'there'
#+end_src

Surprising result (AKA nothing) below:
#+RESULTS: surprise

leads to the following output:

,----
| s = 3
| t = 4
| 'result = %d' % (s + t)
`----

Working result below:
,----
| result = 7
`----



,----
| try:
|     'hi'
| except:
|     'there'
`----

Surprising result (AKA nothing) below:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]