emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* babel - python question
@ 2013-07-05 12:44 Rustom Mody
  2013-07-05 14:28 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Rustom Mody @ 2013-07-05 12:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

[Complete babel noob here]

Following the babel doc
http://orgmode.org/worg/org-contrib/babel/intro.html#library-of-babel

I wrote this

* Head
#+name: ppp :results value
#+begin_src python
import time
print("Hello, today's date is %s" % time.ctime())
print('Two plus two is')
return 2 + 2
#+end_src

Hit C-c C-c

and got a new block

#+RESULTS:
: 4


I am mystified!
In python a top level return gives a syntax error.
Here it works. Is some secret function being created?

Also the results changed to output does not change the behavior

[-- Attachment #2: Type: text/html, Size: 763 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-05 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 12:44 babel - python question Rustom Mody
2013-07-05 14:28 ` Eric Schulte

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).