* [Babel][BUG] Executing python code fails due to indentation error
@ 2010-09-06 23:06 Seth Burleigh
2010-09-07 22:25 ` Noorul Islam
2010-09-07 22:44 ` Eric Schulte
0 siblings, 2 replies; 4+ messages in thread
From: Seth Burleigh @ 2010-09-06 23:06 UTC (permalink / raw)
To: Emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 225 bytes --]
#+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.
[-- Attachment #1.2: Type: text/html, Size: 309 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Babel][BUG] Executing python code fails due to indentation error
2010-09-06 23:06 [Babel][BUG] Executing python code fails due to indentation error Seth Burleigh
@ 2010-09-07 22:25 ` Noorul Islam
2010-09-07 22:44 ` Eric Schulte
1 sibling, 0 replies; 4+ messages in thread
From: Noorul Islam @ 2010-09-07 22:25 UTC (permalink / raw)
To: Seth Burleigh; +Cc: Emacs-orgmode
On Tue, Sep 7, 2010 at 4:36 AM, Seth Burleigh <wburle@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Babel][BUG] Executing python code fails due to indentation error
2010-09-06 23:06 [Babel][BUG] Executing python code fails due to indentation error Seth Burleigh
2010-09-07 22:25 ` Noorul Islam
@ 2010-09-07 22:44 ` Eric Schulte
2010-09-08 3:11 ` Seth Burleigh
1 sibling, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2010-09-07 22:44 UTC (permalink / raw)
To: Seth Burleigh; +Cc: Emacs-orgmode
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 <wburle@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Babel][BUG] Executing python code fails due to indentation error
2010-09-07 22:44 ` Eric Schulte
@ 2010-09-08 3:11 ` Seth Burleigh
0 siblings, 0 replies; 4+ messages in thread
From: Seth Burleigh @ 2010-09-08 3:11 UTC (permalink / raw)
To: Eric Schulte; +Cc: Emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1367 bytes --]
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.eric@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 <wburle@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
>
[-- Attachment #1.2: Type: text/html, Size: 2079 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-08 3:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 23:06 [Babel][BUG] Executing python code fails due to indentation error Seth Burleigh
2010-09-07 22:25 ` Noorul Islam
2010-09-07 22:44 ` Eric Schulte
2010-09-08 3:11 ` Seth Burleigh
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).