Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > no output of pyhton in emacs shell buffer

Reply
Thread Tools

no output of pyhton in emacs shell buffer

 
 
leo
Guest
Posts: n/a
 
      12-22-2003
hi there

in an emacs shell buffer i get no output of python, even no ">>>"-prompt.

however, behind the scene python still works, i can type a command blindly,
and _after quitting python_ the associated output is written to the shell
buffer.

some shell config seems to be wrong. my shell buffer sttings are:
(setq shell-file-name "bash")
(setq explicit-shell-file-name shell-file-name)
(setenv "SHELL" shell-file-name)
(setq explicit-sh-args '("-login" "-i"))
(setq shell-command-switch "-c")

i work with ntemacs, the and the cygwin python 2.3.2

any idea?

thanks, leo


 
Reply With Quote
 
 
 
 
EP
Guest
Posts: n/a
 
      12-22-2003
Oops. copied wrong:

> >>> result=function1(first=parameter, end='noodles','Jim Beam', 'Poker')


strike that.

It was actually:

>>> result=function1('Jim Beam', 'Poker',first=parameter,end='noodles')


and got this error:

>TypeError: function1() got multiple values for keyword argument 'first'



 
Reply With Quote
 
 
 
 
Benjamin Riefenstahl
Guest
Posts: n/a
 
      12-22-2003
Hi Leo,


"leo" <(E-Mail Removed)> writes:
> in an emacs shell buffer i get no output of python, even no
> ">>>"-prompt.
>
> however, behind the scene python still works, i can type a command
> blindly, and _after quitting python_ the associated output is
> written to the shell buffer.
> [...]
> i work with ntemacs, the and the cygwin python 2.3.2


Native Windows doesn't have pseudo-ttys. The python interpreter sees
that it is running in a pipe, and thinks that this is non-interactive
environment, instead of an interactive terminal. You could try to
force the python interpreter into interactive mode in some other way
(command option, configuration item).

Also, Cygwin Emacs would probably fix that problem, because Cygwin can
simulate pseudo-ttys between Cygwin applications.


benny
 
Reply With Quote
 
Jp Calderone
Guest
Posts: n/a
 
      12-22-2003
On Sun, Dec 21, 2003 at 10:32:25PM -0800, EP wrote:
> Oops. copied wrong:
>
> >>>> result=function1(first=parameter, end='noodles','Jim Beam', 'Poker')

>
> strike that.
>
> It was actually:
>
> >>> result=function1('Jim Beam', 'Poker',first=parameter,end='noodles')

>
> and got this error:
>
> >TypeError: function1() got multiple values for keyword argument 'first'

>


'Jim Beam' is passed as an argument for "first". 'Poker' as an argument
for "end". Then, parameter is passed as an argument for "first", and
'noodles' as an argument for "end". No arguments are passed for the
*argument (I forget what it was called in your example).

In general, the first argument matches up with the first parameter, the
second with the second, and so forth.

Does this make sense now?

Jp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/5v4jedcO2BJA+4YRAv3qAJwJ3k0TnIePfrTTI4afUgjnSp5CVw Cg1Reh
d5/7vOJ2e4ZVBfOKNJDrJMk=
=3UAc
-----END PGP SIGNATURE-----

 
Reply With Quote
 
EP
Guest
Posts: n/a
 
      12-22-2003

> > >>> result=function1('Jim Beam', 'Poker',first=parameter,end='noodles')

> >
> > and got this error:
> >
> > >TypeError: function1() got multiple values for keyword argument 'first'

> >

>
> 'Jim Beam' is passed as an argument for "first". 'Poker' as an argument
>for "end". Then, parameter is passed as an argument for "first", and
>'noodles' as an argument for "end". No arguments are passed for the
>*argument (I forget what it was called in your example).
>
> In general, the first argument matches up with the first parameter, the
>second with the second, and so forth.



This seems to be what is happening but does not seem compatible with the
rules (or maybe my expectations):

1) keyword arguments must appear after non-keyword arguments in the call.
2) in the function header, *arguments must come after normal arguments and
defaults

If I am concluding correctly, this means that keywords cannot be used in a
function call for a function header like this

def function(value1=x, value2=y, *arguments)
Is that right? the two rules mean that keywords will out of "position",
source to target; but why would keywords have to be accessed by position,
aren't they akin to a dictionary?

Not a terrible limitation, was just not expected.

Eric

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
os.popen output different from native shell output nickname Python 7 08-26-2009 02:18 PM
Trouble running Emacs-EPL (to run perl in emacs). Adam Funk Perl Misc 4 01-29-2007 10:42 AM
Capturing gdb output in pyhton script using gdb -batch -x arguments Surendra Python 0 03-23-2006 02:47 PM
Pyhton Interpreter Startup time Neil Benn Python 16 08-13-2004 10:33 PM
Acess to PostgreSQL database from Pyhton miguelk Python 1 10-10-2003 05:55 PM



Advertisments