[Idle-dev] Clearing the environment

Patrick K. O'Brien pobrien@orbtech.com
Tue, 7 Aug 2001 13:43:14 -0500


Conceptually I think this is doable. I could imagine two scenarios. One
where you want the shell reset back to square one, as if you had just opened
it up, but without losing the command history. The second would be the same
as the first but in addition you'd want everything reloaded so that your
local namespace was the same as when you called the hypothetical
"shell.reset()" only it would be "fresh". Something like the following is
what I'm thinking:

1. if necessary, copy the command history so it won't get lost
2. capture the state of the interpreter
3. delete the interpreter object
4. create a new interpreter object
5. reload whatever to get back to the previous state

I'll add that to my to-do list for PyCrust:

http://sourceforge.net/projects/pycrust/

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."

-----Original Message-----
From: idle-dev-admin@python.org [mailto:idle-dev-admin@python.org]On Behalf
Of Mats Wichmann
Sent: Tuesday, August 07, 2001 11:06 AM
To: idle-dev@python.org
Subject: [Idle-dev] Clearing the environment

<snip>

Speaking for me now,

I can see situations where I'd like to have the environment
in the "shell" reset, but the command history remembered,
so just wiping out the shell window before rerunning the
scipt is not ideal.  Like, if I've tried out some manual
inspection commands that showed a problem in the module
under development; I'd like to rerun in a clean environment
yet be able to call those commands back.  Reload is only
sometimes the answer...

Is this a silly desire?  /Is/ there a reasonable way to
accomplish this?

Mats


_______________________________________________
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev