Re: [Orgmode] [Babel][BUG] Executing python code fails due to indentation error

2010-09-08 Thread Seth Burleigh
Youre right, without a session it works, but with a session it doesn't. Any
pointers for why this wouldn't work in the shell? I really need python for

On Tue, Sep 7, 2010 at 5:44 PM, Eric Schulte schulte.e...@gmail.com wrote:

 Hi Seth,

 This works fine for me with external evaluation, e.g.
 --8---cut here---start-8---
 #+begin_src python
 def add(a,b):
   return a+b
 def sub(a,b):
   return a-b
 return add(sub(10,1),sub(10,2))
 #+end_src

 #+results:
 : 17
 --8---cut here---end---8---

 I did notice that when I added a :session test header argument the
 interactive shell output the error you mentioned.  This issue would have
 to be resolved by the Python inferior process either python-mode or
 python-shell.

 Best -- Eric

 Seth Burleigh wbu...@gmail.com writes:

  #+begin_src python
  def add(a,b):
 return a+b
  def sub(a,b):
 return a-b
  #+end_src
 
  Fails to execute due to 'unexpected indentation' in general, this is a
  problem for copy/pasting into any emacs python shell, it wont work.
  ___
  Emacs-orgmode mailing list
  Please use `Reply All' to send replies to the list.
  Emacs-orgmode@gnu.org
  http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [Babel][BUG] Executing python code fails due to indentation error

2010-09-07 Thread Seth Burleigh
#+begin_src python
def add(a,b):
   return a+b
def sub(a,b):
   return a-b
#+end_src

Fails to execute due to 'unexpected indentation' in general, this is a
problem for copy/pasting into any emacs python shell, it wont work.
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [Babel][BUG] Executing python code fails due to indentation error

2010-09-07 Thread Noorul Islam
On Tue, Sep 7, 2010 at 4:36 AM, Seth Burleigh wbu...@gmail.com wrote:
 #+begin_src python
 def add(a,b):
    return a+b
 def sub(a,b):
    return a-b
 #+end_src
 Fails to execute due to 'unexpected indentation' in general, this is a
 problem for copy/pasting into any emacs python shell, it wont work.

I copy pasted everything above and I did C-c C-c @ #+begin and it worked.

Am I not getting you?

Thanks and Regards
Noorul

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [Babel][BUG] Executing python code fails due to indentation error

2010-09-07 Thread Eric Schulte
Hi Seth,

This works fine for me with external evaluation, e.g.
--8---cut here---start-8---
#+begin_src python
def add(a,b):
   return a+b
def sub(a,b):
   return a-b
return add(sub(10,1),sub(10,2))
#+end_src

#+results:
: 17
--8---cut here---end---8---

I did notice that when I added a :session test header argument the
interactive shell output the error you mentioned.  This issue would have
to be resolved by the Python inferior process either python-mode or
python-shell.

Best -- Eric

Seth Burleigh wbu...@gmail.com writes:

 #+begin_src python
 def add(a,b):
return a+b
 def sub(a,b):
return a-b
 #+end_src

 Fails to execute due to 'unexpected indentation' in general, this is a
 problem for copy/pasting into any emacs python shell, it wont work.
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode