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


Groups > comp.lang.python > #41191

Re: Store a variable permanently

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=777719218=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.033
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'syntax': 0.03; 'that?': 0.05; 'python': 0.09; 'cc:addr:python-list': 0.10; 'slightly': 0.15; 'subject:Store': 0.16; 'subject:variable': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'shell': 0.18; 'code,': 0.18; 'import': 0.21; 'error.': 0.21; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '+0100,': 0.29; 'pickle': 0.29; 'steven': 0.29; 'no,': 0.29; 'writes': 0.30; 'file': 0.32; '-----': 0.32; 'but': 0.36; 'should': 0.36; 'thank': 0.36; 'subject:: ': 0.38; 'store': 0.38; 'gives': 0.39; 'you.': 0.61; 'received:194': 0.61; 'information': 0.63; 'person,': 0.65; 'disclose': 0.69; 'notice:': 0.71; 'privileged.': 0.72; 'topic,': 0.78; '2013': 0.84; 'actually,': 0.84; 'medium.': 0.91; 'try.': 0.91
X-IronPort-AV E=Sophos;i="4.84,839,1355094000"; d="scan'208";a="1282906"
X-Virus-Scanned amavisd-new at zimbra.sequans.com
Date Wed, 13 Mar 2013 19:47:26 +0100 (CET)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To Steven D'Aprano <steve+comp.lang.python@pearwood.info>
In-Reply-To <5140b946$0$29965$c3e8da3$5496439d@news.astraweb.com>
Subject Re: Store a variable permanently
MIME-Version 1.0
X-Mailer Zimbra 7.2.2_GA_2852 (ZimbraWebClient - GC7 (Linux)/7.2.2_GA_2852)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3269.1363200454.2939.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1363200454 news.xs4all.nl 6884 [2001:888:2000:d::a6]:34747
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41191

Show key headers only | View raw


----- Original Message -----
> 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

Well, slightly off topic, but you should give it a try. It's the python shell, just better.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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


Thread

Re: Store a variable permanently Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-03-13 19:47 +0100

csiph-web