emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Andrea Crotti <andrea.crotti.0@gmail.com>
Cc: Org mode <emacs-orgmode@gnu.org>
Subject: Re: [babel] python sessions
Date: Mon, 04 Jul 2011 11:23:16 -0600	[thread overview]
Message-ID: <877h7ynel8.fsf@gmail.com> (raw)
In-Reply-To: sa062njchzk.fsf@gmail.com

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

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Eric Schulte <schulte.eric@gmail.com> writes:
>
>>
>> From what I hear the situation should improve in Emacs24, as there is a
>> ground up re-write which should contain much of the functionality of
>> python-mode.el with the Emacs-amenable license of python.el.
>>
>
> Nice to know, I use python-mode.el and emacs24, but I would vote for a
> merge :)
>
>>
>> The eoe string will only even appear in session output when there is no
>> other result returned by the code block.  I've just pushed up a small
>> change which should fix this situation.
>>
>> The eoe will never appear in tangled code as it is part of the
>> interactive session evaluation.
>>
>> Best -- Eric
>
> I think the last patch created some problems, now it often (but not
> always and I can't get why) when I execute the source block, and still I
> can't make it work the previous example that I posted...
>

I don't understand.  What do python code blocks often do after
application of the new patch?

Using this attached minimal emacs configuration [1] I was able to
evaluate the code blocks in this simple org-mode file [2] starting Emacs
with the following.


: emacs -Q -l minimal.el short.org

Perhaps your problems are related to use of python-mode.el?

Best -- Eric


Footnotes: 
[1]  minimal.el

[-- Attachment #2: minimal.el --]
[-- Type: application/emacs-lisp, Size: 410 bytes --]

[-- Attachment #3: Type: text/plain, Size: 16 bytes --]


[2]  short.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: short.org --]
[-- Type: text/x-org, Size: 240 bytes --]

#+begin_src python :session :results output
  def var(x):
      return float(x ** 2)
#+end_src

#+results:

#+begin_src python :session :result value
  def var2(x):
      return x ** 2 * var(x)
  
  var2(10)
#+end_src

#+results:
: 10000.0

[-- Attachment #5: Type: text/plain, Size: 48 bytes --]



-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

      reply	other threads:[~2011-07-04 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-03 12:18 [babel] python sessions Andrea Crotti
2011-07-03 15:15 ` Eric Schulte
2011-07-03 16:51   ` Andrea Crotti
2011-07-03 18:13     ` Eric Schulte
2011-07-03 18:54       ` Andrea Crotti
2011-07-04 17:23         ` 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=877h7ynel8.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=andrea.crotti.0@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).