emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: "R. Michael Weylandt" <michael.weylandt@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Odd interaction with Python sessions and Org 8.2.5
Date: Thu, 06 Mar 2014 15:06:28 -0700	[thread overview]
Message-ID: <87y50nt1jz.fsf@gmail.com> (raw)
In-Reply-To: CAAmySGMZMnALXpX8pT9=wci3N3TWpA55f4Yzsr+3svkKxnfarQ@mail.gmail.com

Hi Michael,

I believe this is a limitation of the current Python session support.
The relevant code is in lisp/ob-python.el and any fix would probably end
up modifying the `org-babel-python-evaluate-session' function.

Best,

"R. Michael Weylandt" <michael.weylandt@gmail.com> writes:

> Hi,
>
> I'm having trouble getting clean output from org 8.2.5 when I combine
> session based evaluation and capturing results from standard out. (See
> first example below)
>
> This is on Emacs 24.3 with the default python mode settings and
> nothing relevant in my init.el except for activating python support.
>
> Is this expected behavior or is there someway I can fix the first example?
>
> Michael
>
> <---------8---------------------------8---------------->
>
> #+TITLE: Hello World
> * Standard Out + Session (Problem)
> #+BEGIN_SRC python :results output :session *Python*
> def test():
>     print "Hello World"
>
> test()
> #+END_SRC
>
> #+RESULTS:
> :
> : ... >>> Hello World
>
> * Standard Out + No Session (Fine)
>
> #+BEGIN_SRC python :results output
> def test():
>     print "Hello World"
>
> test()
> #+END_SRC
>
> #+RESULTS:
> : Hello World
>
> * Value + Session
> #+BEGIN_SRC python :session *Python*
> def test():
>     print "Hello World"
>
> test()
> #+END_SRC
>
> #+RESULTS:
>
> * Value + No Session
> #+BEGIN_SRC python
> def test():
>     print "Hello World"
>
> test()
> #+END_SRC
>
> #+RESULTS:
> : None
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

      reply	other threads:[~2014-03-06 22:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  3:02 Odd interaction with Python sessions and Org 8.2.5 R. Michael Weylandt
2014-03-06 22:06 ` Eric Schulte [this message]

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=87y50nt1jz.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael.weylandt@gmail.com \
    /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).