emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Python Code Block error with header option :results output


From: Ahmadou Dicko
Subject: Re: [O] Python Code Block error with header option :results output
Date: Fri, 31 Jan 2014 21:33:36 +0000

I'm not a Python expert too but I don't that return statement can be used as is on the fly.
So, yes is the expected behavior of Python

Try instead

#+begin_src python :results output
  a = (1, 2, 3, 4)
  print(a)
#+end_src

#+RESULTS:
: (1, 2, 3, 4)



On Fri, Jan 31, 2014 at 9:24 PM, Soapy Smith <address@hidden> wrote:
Hello-

I am not a user of Python (yet).  During a comparison of code block
behavior between Clojure and Python, I discovered a possible Python
error.

Here is the code block:

#+begin_src python :results output
 a = (1, 2, 3, 4)
 return a
#+end_src

The evaluation of this block results in this error:

  File "<stdin>", line 2
SyntaxError: 'return' outside function

Could someone please comment if this is expected Python behavior?

I am using org 8.2.4.

Regards,
Greg





--
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : address@hidden
twitter : @dickoah
github : github/dickoa
tel : +221 33 827 55 16
portable: +221 77 123 81 69

reply via email to

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