emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] python sessions


From: John Hendy
Subject: Re: [O] python sessions
Date: Tue, 26 Mar 2013 16:47:20 -0500

On Tue, Mar 26, 2013 at 4:41 PM, Gary Oberbrunner <address@hidden> wrote:
> I did some further testing.  With my patch, my real org-mode python file is
> now actually working.  There were a few gotchas I didn't understand about
> session mode and python and matplotlib:
>
> 1. In session mode, you are essentially running an interactive python.
> (This is made explicit by my patch, which passes -i).
> 2. In interactive mode, blank lines are special: they indicate the end of an
> indented block.  So you have to write your org-mode python a little
> differently when using session mode.
> 3. matplotlib uses an "interactive" backend when started from an interactive
> python (sensibly).  So you have to set the backend explicitly when using
> session mode, or it hangs forever with no indication what's wrong.
> 4. ob-python does not handle python errors at all in session mode: it
> ignores them silently.  This makes it really hard to debug the python code.
>
> I'd like to document #s 1-3; where should that go?
> I'd like to work on a patch for #4; it seems like the only thing is to
> search in the session buffer for likely error strings.  Is there any better
> method anyone can think of?

You should probably create ob-doc-python:
- http://orgmode.org/tmp/worg/org-contrib/babel/languages.html

If you haven't contributed before:
- http://orgmode.org/worg/worg-git.html

Once you clone (after submitting ssh key) with =git clone
address@hidden:worg.git=, you'd create:

~/path/to/worg.git/org-contrib/babel/languages/ob-doc-python.org

There's a template at:

~/path/to/worg.git/org-contrib/babel/languages/ob-doc-template.org

Thanks for doing this! I can't believe there's no existing page for
Python on Worg. Maybe you can document more than just this, too :)


John

>
> --
> Gary



reply via email to

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