emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Shiyuan <gshy2014@gmail.com>
To: "Doyley, Marvin" <mdoyley@ur.rochester.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: babel python example not reproducible
Date: Sun, 15 Jun 2014 22:59:26 -0700	[thread overview]
Message-ID: <CAOm4EMsLghWfa6++0dFvkNWqJiQaR4287M+fT8+A2_QQ60kZgQ@mail.gmail.com> (raw)
In-Reply-To: <m2d2efdgyz.fsf@ur.rochester.edu>

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

The two setting doesn't seem to have effect.
(setq python-shell-interpreter "ipython")
(setq python-shell-interpreter-args "--pylab")
When I did `C-c C-c` on the SRC block to execute the code, emacs created a
buffer with the interior python process. When I switched to the process, I
saw it is python 2.5.3, not ipython.

Also, it looks like the problem is with the shell interpreter. If I enter
command directly in the shell buffer, the shell buffer will echo command
itself and then the result.

>>> print "Hello"
print "Hello"
Hello.

Is there any setting to control this shell behavior? Can I make the python
shell not echo the command? Thanks.


On Wed, Jun 11, 2014 at 12:48 AM, Doyley, Marvin <mdoyley@ur.rochester.edu>
wrote:

> Works for me, see example below
> #+BEGIN_SRC python :results output :session foo
>
> x=100
> print "hello"
> 2
> print "bye"
> #+END_SRC
>
> #+RESULTS:
> :
> : >>> hello
> : 2
> : bye
>
> #+BEGIN_SRC python :results output :session foo
>
> print "hello good bye"
> print "Printing value from previous session", x
> #+END_SRC
>
> #+RESULTS:
> :
> : hello good bye
> : Printing value from previous session 100
>
> The only difference is that I like to give my session a name and for
> what it is worth I am using ipython (don't think this will make a
> difference). You can do this including the
> following statement in your .emacs file
>
> (setq python-shell-interpreter "ipython")
> (setq python-shell-interpreter-args "--pylab")
>
> Hope this help.
> Cheers,
> M
>
>
>

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

  reply	other threads:[~2014-06-16  5:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  5:11 babel python example not reproducible Shiyuan
2014-06-11  7:48 ` Doyley, Marvin
2014-06-16  5:59   ` Shiyuan [this message]
2014-06-16 12:19     ` Nick Dokos
2014-06-16 14:35     ` Doyley, Marvin
2014-06-16 15:03       ` Eric Schulte
2014-06-16 16:12         ` Doyley, Marvin
2014-06-17  6:21           ` Shiyuan
2014-06-17 11:54             ` Andreas Röhler
2014-06-18 14:02               ` Eric Schulte
2014-06-18 13:59             ` Eric Schulte
2014-06-19  5:57               ` Andreas Röhler
2014-06-19 13:40                 ` Eric Schulte
2014-06-20  5:53                   ` Andreas Röhler

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=CAOm4EMsLghWfa6++0dFvkNWqJiQaR4287M+fT8+A2_QQ60kZgQ@mail.gmail.com \
    --to=gshy2014@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdoyley@ur.rochester.edu \
    /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).