Store a variable permanently

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Mar 13 18:37:10 CET 2013


On Tue, 12 Mar 2013 12:54:11 +0100, Jean-Michel Pichavant wrote:

>> > import pickle
>> > a = 758
>> > pickle.dump(a, open('test.pickle', 'w')) 
>> > !cat test.pickle
>> > I758
>> > .
>> 
>> 
>> What is that? It's not Python code, !cat test.pickle gives a syntax
>> error.
> 
> It's a IPython shell session, !cat test.pickle writes the content of
> that file to stdout. But I have the feeling you already know that ;)

Actually, no, I don't use IPython and am not familiar with it.


-- 
Steven



More information about the Python-list mailing list