saving interpreter source?
Dave Kuhlman
dkuhlman at rexx.com
Wed Apr 21 19:35:21 EDT 2004
Dave Kuhlman wrote:
> 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.
Oops. Forgot the link. Here it is:
http://docs.python.org/lib/readline-example.html
Dave
--
http://www.rexx.com/~dkuhlman
More information about the Python-list
mailing list