no output of pyhton in emacs shell buffer

Discussion in 'Python' started by leo, Dec 22, 2003.

  1. leo

    leo Guest

    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
    leo, Dec 22, 2003
    #1
    1. Advertising

  2. leo

    EP Guest

    Re: calling the function police

    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'
    EP, Dec 22, 2003
    #2
    1. Advertising

  3. Hi Leo,


    "leo" <> 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
    Benjamin Riefenstahl, Dec 22, 2003
    #3
  4. leo

    Jp Calderone Guest

    Re: calling the function police

    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+4YRAv3qAJwJ3k0TnIePfrTTI4afUgjnSp5CVwCg1Reh
    d5/7vOJ2e4ZVBfOKNJDrJMk=
    =3UAc
    -----END PGP SIGNATURE-----
    Jp Calderone, Dec 22, 2003
    #4
  5. leo

    EP Guest

    Re: calling the function police


    > > >>> 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
    EP, Dec 22, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. miguelk
    Replies:
    1
    Views:
    338
    Rene Pijlman
    Oct 10, 2003
  2. Neil Benn

    Pyhton Interpreter Startup time

    Neil Benn, Aug 12, 2004, in forum: Python
    Replies:
    16
    Views:
    803
    Neuruss
    Aug 13, 2004
  3. Guest

    Email client in Pyhton

    Guest, Aug 24, 2005, in forum: Python
    Replies:
    3
    Views:
    359
    Nemesis
    Aug 24, 2005
  4. Surendra
    Replies:
    0
    Views:
    500
    Surendra
    Mar 23, 2006
  5. Adam Funk
    Replies:
    4
    Views:
    221
    Adam Funk
    Jan 29, 2007
Loading...

Share This Page