Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16156

Re: python shell that saves history of typed in commands that will persist between reboots

Date 2011-11-24 08:51 +0000
From Tim Golden <mail@timgolden.me.uk>
Subject Re: python shell that saves history of typed in commands that will persist between reboots
References (3 earlier) <mailman.2965.1322044680.27778.python-list@python.org> <4ecda8ea$0$30003$c3e8da3$5496439d@news.astraweb.com> <mailman.2990.1322109066.27778.python-list@python.org> <4ecde007$0$30003$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmp_Fix189fkuAvZpH+ywg-18tLMYwUZOywccy0W6uT4iA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2999.1322124705.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 24/11/2011 06:22, Chris Angelico wrote:
> On Thu, Nov 24, 2011 at 5:11 PM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info>  wrote:
>> One of us is confused, and I'm pretty sure it's you :)
>>
>> Tim went on to say "Obviously this only applies when an underlying cmd
>> session persists", which I understood as implying that he too is using
>> Linux where Ctrl-Z stops the process, but does not exit it.
>
> Entirely possible :) I blithely assumed from the fact that he said
> "dir" that it was Windows, but it goes to show what happens when you
> assume.

Ahem. Sorry for any confusion caused. The OP was asking about the
situation on Windows, and I was responding in that context. The
Ctrl-Z thing is what *exits* the interpreter on Windows (a la Ctrl-D
on Linux).

In short - on Windows, within one cmd shell you can open and exit
the interpreter as many times as you like and the Python command
history will be retained via the cmd shell's history mechanism,
and kept distinct from the history of other things you may type
into the cmd shell.

If you exit the cmd shell then that history is lost, and I'm not
aware of any mechanism for retaining it.

All this may or may not be of any use to the OP. I was responding
to this comment by Steven:

"The default interactive interpreter for Python doesn't have persistent
history, so if you exit the interpreter and restart it, your commands
are gone."


TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python shell that saves history of typed in commands that will persist between reboots goldtech <goldtech@worldpost.com> - 2011-11-15 19:38 -0800
  Re: python shell that saves history of typed in commands that will persist between reboots sword <john.37@gmail.com> - 2011-11-15 19:45 -0800
  Re: python shell that saves history of typed in commands that will persist between reboots Tim Golden <mail@timgolden.me.uk> - 2011-11-16 08:37 +0000
  Re: python shell that saves history of typed in commands that will persist between reboots Ben Finney <ben+python@benfinney.id.au> - 2011-11-17 08:09 +1100
    Re: python shell that saves history of typed in commands that will persist between reboots David Robinow <drobinow@gmail.com> - 2011-11-16 18:46 -0500
      Re: python shell that saves history of typed in commands that will persist between reboots Ben Finney <ben+python@benfinney.id.au> - 2011-11-17 10:59 +1100
        Re: python shell that saves history of typed in commands that will persist between reboots David Robinow <drobinow@gmail.com> - 2011-11-16 19:49 -0500
        Re: python shell that saves history of typed in commands that will persist between reboots Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-11-24 15:05 +0100
    Re: python shell that saves history of typed in commands that will persist between reboots alex23 <wuwei23@gmail.com> - 2011-11-16 19:04 -0800
  Re: python shell that saves history of typed in commands that will persist between reboots Anssi Saari <as@sci.fi> - 2011-11-23 11:23 +0200
    Re: python shell that saves history of typed in commands that will persist between reboots Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-23 10:29 +0000
      Re: python shell that saves history of typed in commands that will persist between reboots Tim Golden <mail@timgolden.me.uk> - 2011-11-23 10:37 +0000
        Re: python shell that saves history of typed in commands that will persist between reboots Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-24 02:16 +0000
          Re: python shell that saves history of typed in commands that will persist between reboots Chris Angelico <rosuav@gmail.com> - 2011-11-24 15:30 +1100
            Re: python shell that saves history of typed in commands that will persist between reboots Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-24 06:11 +0000
              Re: python shell that saves history of typed in commands that will persist between reboots Chris Angelico <rosuav@gmail.com> - 2011-11-24 17:22 +1100
              Re: python shell that saves history of typed in commands that will persist between reboots Tim Golden <mail@timgolden.me.uk> - 2011-11-24 08:51 +0000
                Re: python shell that saves history of typed in commands that will persist between reboots alex23 <wuwei23@gmail.com> - 2011-11-24 19:49 -0800
                Re: python shell that saves history of typed in commands that will persist between reboots Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-11-25 11:37 +0100
                Re: python shell that saves history of typed in commands that will persist between reboots Tim Golden <mail@timgolden.me.uk> - 2011-11-25 11:29 +0000
                Re: python shell that saves history of typed in commands that will persist between reboots 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-25 15:19 -0800
                Re: python shell that saves history of typed in commands that will persist between reboots 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-25 15:19 -0800
              Re: python shell that saves history of typed in commands that will persist between reboots Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-11-24 10:11 -0800
        Re: python shell that saves history of typed in commands that will persist between reboots alex23 <wuwei23@gmail.com> - 2011-11-24 19:47 -0800
          Re: python shell that saves history of typed in commands that will persist between reboots Tim Golden <mail@timgolden.me.uk> - 2011-11-25 08:58 +0000
            Re: python shell that saves history of typed in commands that will persist between reboots alex23 <wuwei23@gmail.com> - 2011-11-25 19:42 -0800
  Re: python shell that saves history of typed in commands that will persist between reboots DevPlayer <devplayer@gmail.com> - 2011-11-27 17:20 -0800

csiph-web