saving interpreter source?

Dave Kuhlman dkuhlman at rexx.com
Wed Apr 21 17:54:03 EDT 2004


Peter Hansen wrote:

> Garett wrote:
> 
>> Hello, I would like to be able to save source typed into the
>> interpreter to a file. Kind of like marshal, but I would like to
>> have the file contain the source so I can edit it later.
>> Something like inspect.getsource() but for source typed into the
>> interpreter, not imported from a module. Is this possible? Any
>> ideas are greatly appreciated. -Garett
> 
> Last time I used it, Chris Gonnerman's readline replacement kept a
> history by default:
> 
> http://newcenturycomputers.net/projects/readline.html

Also, take a look at the following.  It tells you how to configure
your interactive sessions so that both (1) interactive history
will be saved to a file and (2) that history will be available in
subsequent interactive sessions.

Dave

-- 
http://www.rexx.com/~dkuhlman




More information about the Python-list mailing list