unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: python novice
  2005-09-06 22:20 python novice Adam
@ 2005-09-06 21:12 ` Kevin Rodgers
       [not found] ` <mailman.6113.1126042198.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2005-09-06 21:12 UTC (permalink / raw)


Adam wrote:
 > I have an example python program in
 > a buffer called test.py
 >
 > am using GNU Emacs 21.3.2 (a mandrake version)
 > C-h m  shows python bindings for that buffer
 >
 > So when I C-c C-c  (py-execute-buffer)
 > I receive the error;
 >
 > "Wrong argument type: sequencep, cpython"
 >
 > Whereas the same python program saved chmod +x and
 > run from the $ prompt works fine.
 >
 > How should I go about finding out about that error message ?

(setq debug-on-error t)

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* python novice
@ 2005-09-06 22:20 Adam
  2005-09-06 21:12 ` Kevin Rodgers
       [not found] ` <mailman.6113.1126042198.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Adam @ 2005-09-06 22:20 UTC (permalink / raw)


I have an example python program in 
a buffer called test.py 

am using GNU Emacs 21.3.2 (a mandrake version)
C-h m  shows python bindings for that buffer 

So when I C-c C-c  (py-execute-buffer)  
I receive the error;  

"Wrong argument type: sequencep, cpython"  

Whereas the same python program saved chmod +x and 
run from the $ prompt works fine. 

How should I go about finding out about that error message ? 

Should I download the emacs python stuff from 
www.python.org/emacs ? 
as that would involve crashing it in on top of any existing 
python bindings that I seem to have at present. 
and it says there Emacs 20 versions, whereas I'm on 21.3 

Should I remove the existing Python package from 
my current emacs before installing the python ones ? 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
       [not found] ` <mailman.6113.1126042198.20277.help-gnu-emacs@gnu.org>
@ 2005-09-07 16:02   ` Adam
  2005-09-07 16:29     ` Adam
  2005-09-07 22:39     ` Kevin Rodgers
  0 siblings, 2 replies; 10+ messages in thread
From: Adam @ 2005-09-07 16:02 UTC (permalink / raw)




> (setq debug-on-error t)

I stuck this into the *scratch* buffer, C-j didn't 
work so I did eval-region to it. Now I get the 
error reported as below. Hmmm ... 

Seems I'm in python-mode, however this is a Lisp 
of Emacs error - telling me .. something. 

Seems I should hit the Emacs manual. Unless any 
further hints. My assumption is that Emacs should 
be great for Python work. 



Debugger entered--Lisp error: (wrong-type-argument sequencep cpython)
  py-execute-region(1 278 nil)
  py-execute-buffer(nil)
* call-interactively(py-execute-buffer)


Kevin Rodgers wrote:

> Adam wrote:
>  > I have an example python program in
>  > a buffer called test.py
>  >
>  > am using GNU Emacs 21.3.2 (a mandrake version)
>  > C-h m  shows python bindings for that buffer
>  >
>  > So when I C-c C-c  (py-execute-buffer)
>  > I receive the error;
>  >
>  > "Wrong argument type: sequencep, cpython"
>  >
>  > Whereas the same python program saved chmod +x and
>  > run from the $ prompt works fine.
>  >
>  > How should I go about finding out about that error message ?
> 
> (setq debug-on-error t)
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
  2005-09-07 16:02   ` Adam
@ 2005-09-07 16:29     ` Adam
  2005-09-07 23:59       ` Tim Johnson
  2005-09-07 22:39     ` Kevin Rodgers
  1 sibling, 1 reply; 10+ messages in thread
From: Adam @ 2005-09-07 16:29 UTC (permalink / raw)



Well, I removed;

#!/usr/bin/env python

from the 1st line of my test.py buffer, 
and the C-c C-c now works fine. Py program 
runs and terminates normally. 

Which prompts me to ask - what do Python 
users do in Emacs so that that 1st line, 
necessary for an executable Python file, 
is transparent when running the file 
from Emacs ?   I suppose run it from 
an Emacs shell only ? 

Thinking further, the executable will 
require chmod before it can be run. This 
suggests running within Emacs is one thing, 
(without that #!/... header), and writing 
a file and chmod to execute is another. 

We seem to be up and running, but any helpful 
pointers or comments welcome. 

 
> Debugger entered--Lisp error: (wrong-type-argument sequencep cpython)
>   py-execute-region(1 278 nil)
>   py-execute-buffer(nil)
> * call-interactively(py-execute-buffer)
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
  2005-09-07 16:02   ` Adam
  2005-09-07 16:29     ` Adam
@ 2005-09-07 22:39     ` Kevin Rodgers
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2005-09-07 22:39 UTC (permalink / raw)


Adam wrote:
 >>(setq debug-on-error t)
 >
 > I stuck this into the *scratch* buffer, C-j didn't
 > work so I did eval-region to it. Now I get the
 > error reported as below. Hmmm ...
 >
 > Seems I'm in python-mode, however this is a Lisp
 > of Emacs error - telling me .. something.
 >
 > Seems I should hit the Emacs manual. Unless any
 > further hints. My assumption is that Emacs should
 > be great for Python work.
 >
 >
 >
 > Debugger entered--Lisp error: (wrong-type-argument sequencep cpython)
 >   py-execute-region(1 278 nil)
 >   py-execute-buffer(nil)
 > * call-interactively(py-execute-buffer)

I don't know what version of Emacs you're using or what version of
python-mode.el or python.el you're using.  But my crystal ball tells me
you may have set some variable to the cpython symbol instead of the
"cpython" string.

-- 
Kevin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
  2005-09-07 16:29     ` Adam
@ 2005-09-07 23:59       ` Tim Johnson
  2005-09-08  1:42         ` Tim Johnson
       [not found]         ` <mailman.6233.1126144127.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Tim Johnson @ 2005-09-07 23:59 UTC (permalink / raw)


* Adam <nospam@example.com> [050906 17:59]:
> 
> Well, I removed;
> 
> #!/usr/bin/env python
> 
> from the 1st line of my test.py buffer, 
> and the C-c C-c now works fine. Py program 
> runs and terminates normally. 

 Hey Adam:

 Start the python interpreter first
 C-c ! or use the menu

 then run the python execute buffer command
 C-c C-c

 What happens then?
 HTH
 tim

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
  2005-09-07 23:59       ` Tim Johnson
@ 2005-09-08  1:42         ` Tim Johnson
       [not found]         ` <mailman.6233.1126144127.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Tim Johnson @ 2005-09-08  1:42 UTC (permalink / raw)


* Tim Johnson <tim@johnsons-web.com> [050907 16:43]:
> * Adam <nospam@example.com> [050906 17:59]:
> > 
> > Well, I removed;
> > 
> > #!/usr/bin/env python
> > 
> > from the 1st line of my test.py buffer, 
> > and the C-c C-c now works fine. Py program 
> > runs and terminates normally. 
 
  Forgot to say: Retain the she-bang line...
  method below should work if you have the interpreter
  in comint mode first.
  tim

>  Hey Adam:
> 
>  Start the python interpreter first
>  C-c ! or use the menu
> 
>  then run the python execute buffer command
>  C-c C-c
> 
>  What happens then?
>  HTH
>  tim
> 
> -- 
> Tim Johnson <tim@johnsons-web.com>
>       http://www.alaska-internet-solutions.com
> 
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
  2005-09-09  2:35           ` Adam
@ 2005-09-08 15:20             ` Tim Johnson
       [not found]             ` <mailman.6294.1126192790.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Tim Johnson @ 2005-09-08 15:20 UTC (permalink / raw)


* Adam <nospam@example.com> [050908 02:55]:
> 
> [ ... ]
> 
> Python 2.3.3 (#2, Feb 17 2004, 11:45:40) 
> [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> ## working on region in file /home/ahc/tmp/python-2745nWq.py...
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/home/ahc/tmp/python-2745nWq.py", line 17
>     break
 
    What you see now is a python error. 
    tj

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
       [not found]         ` <mailman.6233.1126144127.20277.help-gnu-emacs@gnu.org>
@ 2005-09-09  2:35           ` Adam
  2005-09-08 15:20             ` Tim Johnson
       [not found]             ` <mailman.6294.1126192790.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Adam @ 2005-09-09  2:35 UTC (permalink / raw)


Tim Johnson wrote:

[ ... ]
>>  Hey Adam:
>> 
>>  Start the python interpreter first
>>  C-c ! or use the menu
>> 
>>  then run the python execute buffer command
>>  C-c C-c
>> 
>>  What happens then?
>>  HTH
>>  tim

Still have a problem, as below. 

And even with the interpreter then in comint-mode, 
the same result.  So looks a little like my mandrake 
version Emacs. No worry, am Pythoning satisfactorily 
without the header. [Am Emacs novice, so perhaps 
down the track . . ].   

Many thanks, am still getting up speed. 

Emacs C-c ! from Python buffer provides >>> in new 
buffer. The C-c C-c in Py buffer provides the following; 
Then comint-mode in Py buffer, and C-c C-c same result. 


Python 2.3.3 (#2, Feb 17 2004, 11:45:40) 
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> ## working on region in file /home/ahc/tmp/python-2745nWq.py...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/ahc/tmp/python-2745nWq.py", line 17
    break

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: python novice
       [not found]             ` <mailman.6294.1126192790.20277.help-gnu-emacs@gnu.org>
@ 2005-09-09 16:27               ` Adam
  0 siblings, 0 replies; 10+ messages in thread
From: Adam @ 2005-09-09 16:27 UTC (permalink / raw)



You're right. Quick check was on test.py, whereas 
we had moved onto test2.py, as one does. 

So, it works perfectly. 
And pops up a buffer with the Py output. 

beaut - thanks TJ. 


>> Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
>> [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> ## working on region in file /home/ahc/tmp/python-2745nWq.py...
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>>   File "/home/ahc/tmp/python-2745nWq.py", line 17
>>     break
>  
>     What you see now is a python error.
>     tj
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-09-09 16:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-06 22:20 python novice Adam
2005-09-06 21:12 ` Kevin Rodgers
     [not found] ` <mailman.6113.1126042198.20277.help-gnu-emacs@gnu.org>
2005-09-07 16:02   ` Adam
2005-09-07 16:29     ` Adam
2005-09-07 23:59       ` Tim Johnson
2005-09-08  1:42         ` Tim Johnson
     [not found]         ` <mailman.6233.1126144127.20277.help-gnu-emacs@gnu.org>
2005-09-09  2:35           ` Adam
2005-09-08 15:20             ` Tim Johnson
     [not found]             ` <mailman.6294.1126192790.20277.help-gnu-emacs@gnu.org>
2005-09-09 16:27               ` Adam
2005-09-07 22:39     ` Kevin Rodgers

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).