command history behavior in windows and linux

Discussion in 'Python' started by Leo, Aug 29, 2005.

  1. Leo

    Leo Guest

    Does someone know if there is a setting in the python Unix world to
    make the command history behave as it does in the Windows intepreter?
    Specifically, I like the fact that the command history remembers which
    of a sequence of commands is the one that I last issued. For example,
    suppose that I typed the following lines into the interpreter:

    import foo
    for e in foo.container:
    print e

    In Unix, I would have to tap up arrow 3 times for each line:

    up up up gives me "import foo". I press enter.
    up up up gives me "for...". I press enter.
    up up up gives me " print...". I press enter.

    In Windows, I get this behavior I like better:

    up up up gives me "import foo". I press enter.
    down gives me "for...". I press enter.
    down gives me " print...". I press enter.

    How do I get the second behavior to take place in all the platforms I
    use? Also, the windows version remembers my commands across sections.
    How do I enable that in the python version?

    I tried editing the inputrc file that controls the readline library by
    adding the following lines:

    $if python
    set history-preserve-point on
    $endif

    but this did not seem to work.

    TIA,
    Leo.
     
    Leo, Aug 29, 2005
    #1
    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. Stefan Bellon

    Embedding Python and command history

    Stefan Bellon, Sep 20, 2006, in forum: Python
    Replies:
    1
    Views:
    1,149
    Stefan Bellon
    Sep 20, 2006
  2. Replies:
    4
    Views:
    632
  3. Sam Stephenson
    Replies:
    1
    Views:
    262
    Andrew Walrond
    Jun 18, 2005
  4. Replies:
    2
    Views:
    459
    nutso fasst
    Oct 17, 2006
  5. Niall
    Replies:
    3
    Views:
    196
    Niall
    Dec 6, 2006
Loading...

Share This Page