From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Oberbrunner Subject: python sessions Date: Tue, 19 Mar 2013 17:40:06 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8fb1f9c4ee987304d84df25f Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI4GU-0001yo-Ve for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 17:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI4GN-0005pJ-TX for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 17:40:14 -0400 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:59068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI4GN-0005od-Pd for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 17:40:07 -0400 Received: by mail-ob0-f177.google.com with SMTP id eh20so962762obb.22 for ; Tue, 19 Mar 2013 14:40:06 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Mailing List --e89a8fb1f9c4ee987304d84df25f Content-Type: text/plain; charset=ISO-8859-1 I must be failing to understand something. I'm running Emacs 24.3 on Windows, with latest trunk org-mode. I can't get python functions to persist across blocks in session mode. Here's my foo.org: =============== * My Document #+BEGIN_SRC python :exports results :results output :session def foo(x): return x+1 print "hi" #+END_SRC #+RESULTS: : hi #+BEGIN_SRC python :exports results :results output :session print foo(100) print "bye" #+END_SRC ======================== In session mode, shouldn't foo be defined in the second python block? When I export this, I get "NameError: name 'foo' is not defined" I may be doing something wrong, because if I name my python session, I never see a buffer of that name, and I expected to. Any help? -- Gary --e89a8fb1f9c4ee987304d84df25f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I must be failing to understand something. =A0I'm runn= ing Emacs 24.3 on Windows, with latest trunk org-mode. =A0I can't get p= ython functions to persist across blocks in session mode. =A0Here's my = foo.org:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

* My Document
#+BEGIN_SRC python :exports results :results out= put :session
def foo(x):
=A0 return x+1
print= "hi"
#+END_SRC

#+RESULTS:
: hi

#+BE= GIN_SRC python :exports results :results output :session
print fo= o(100)
print "bye"
#+END_SRC

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D

In session mode, shouldn't foo= be defined in the second python block? =A0When I export this, I get "= NameError: name 'foo' is not defined"

I may be doing something wrong, because if = I name my python session, I never see a buffer of that name, and I expected= to. =A0Any help?

--
Gary
--e89a8fb1f9c4ee987304d84df25f--