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


Groups > comp.lang.python > #58536

Re: Help me with this code PLEASE

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <bgailer@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:code': 0.07; 'key.': 0.09; 'received:192.168.1.101': 0.09; 'suffix': 0.09; 'subject:Help': 0.11; 'python': 0.11; 'stored': 0.12; '(slow!)': 0.16; 'chapel': 0.16; 'd[key]': 0.16; 'key)': 0.16; 'keyerror': 0.16; 'subject:PLEASE': 0.16; 'library': 0.18; 'module': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'exists': 0.24; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'code': 0.31; 'keys': 0.31; 'pickle': 0.31; 'file': 0.32; 'open': 0.33; 'subject:with': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'module.': 0.36; 'object,': 0.36; 'list': 0.37; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'delete': 0.39; 'to:addr:python.org': 0.39; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'sample': 0.67; 'subject:this': 0.83; 'hill': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=fJtCCqw/Ojh51pdPhgYiUy1oJTS5jUBbg4NWI4uZLZo=; b=ufJ2a4Gzx+z3kCYutXaGjmmQ+lL+EqT7TfoqdAWZYdG/TKx8eC2If3axTp0pctL65E EuG5MBTF4ca9av6M4V176j2t0eedcsn7SWPGSou7wEiCkF2aLsNUudlm62kXGWGtLkUJ 0Q8o8mgoAtZvzO5m3oCrZ2IY/wsCYBwpCa0hLiK76+8a00MyMrCHpTaLq/zukVzoUzJ2 kFDdWWcPCUOs5gSUEqK1nG6P0LlOcALPA6UYuHCxgQ4i0pX5MF2yznxWLWGLXxFfWQnW AdICVMLPVagI0EDtURT/RYWkIOMAyFtftMuIqmN+4xlqiof38pzVwB1zLzvp10x7mhYG UoBQ==
X-Received by 10.224.131.133 with SMTP id x5mr1597134qas.70.1383693354342; Tue, 05 Nov 2013 15:15:54 -0800 (PST)
Date Tue, 05 Nov 2013 18:15:56 -0500
From bob gailer <bgailer@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version 1.0
To python-list@python.org, Nikos <nikos.gr33k@gmail.com>
Subject Re: Help me with this code PLEASE
References <l5bc94$roa$1@dont-email.me> <20131105223107.GA99421@cskk.homeip.net>
In-Reply-To <20131105223107.GA99421@cskk.homeip.net>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2066.1383693356.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383693356 news.xs4all.nl 15888 [2001:888:2000:d::a6]:48853
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:58536

Show key headers only | View raw


There is also the shelve module.

It uses pickle to marshal a Python object, then stores it in a file 
under a key.

Sample code from the module documentation:

import shelve

d = shelve.open(filename) # open -- file may get suffix added by 
low-level library

d[key] = data   # store data at key (overwrites old data if using an 
existing key)
data = d[key]   # retrieve a COPY of data at key (raise KeyError if no 
such key)
del d[key]      # delete data stored at key (raises KeyError if no such key)
flag = key in d        # true if the key exists
klist = list(d.keys()) # a list of all existing keys (slow!)


-- 
Bob Gailer
919-636-4239
Chapel Hill NC

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


Thread

Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-05 19:06 +0200
  Re: Help me with this code PLEASE Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-05 18:23 +0100
  Re: Help me with this code PLEASE mm0fmf <none@mailinator.com> - 2013-11-05 17:33 +0000
  Re: Help me with this code PLEASE Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-05 17:41 +0000
    Re: Help me with this code PLEASE Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-05 18:53 +0100
    Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-05 19:59 +0200
      Re: Help me with this code PLEASE Tobiah <toby@tobiah.org> - 2013-11-05 10:11 -0800
        Re: Help me with this code PLEASE Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-05 14:01 -0500
  Re: Help me with this code PLEASE Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-05 18:02 +0000
    Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-05 20:09 +0200
      Re: Help me with this code PLEASE Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-05 20:10 +0000
      Re: Help me with this code PLEASE Cameron Simpson <cs@zip.com.au> - 2013-11-06 09:31 +1100
      Re: Help me with this code PLEASE bob gailer <bgailer@gmail.com> - 2013-11-05 18:15 -0500
      Re: Help me with this code PLEASE Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-05 23:36 +0000
  Re: Help me with this code PLEASE John Gordon <gordon@panix.com> - 2013-11-05 20:19 +0000
    Re: Help me with this code PLEASE Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-05 21:17 +0000
    Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-05 23:26 +0200
      Re: Help me with this code PLEASE John Gordon <gordon@panix.com> - 2013-11-05 22:06 +0000
        Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-06 00:28 +0200
          Re: Help me with this code PLEASE Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-05 22:44 +0000
          Re: Help me with this code PLEASE John Gordon <gordon@panix.com> - 2013-11-05 22:54 +0000
            Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-06 03:14 +0200
              Re: Help me with this code PLEASE Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-06 08:49 +0000
              Re: Help me with this code PLEASE Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-06 08:57 -0500
      Re: Help me with this code PLEASE Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-11-06 09:27 +0100
    Re: Help me with this code PLEASE Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-05 21:42 +0000
    Re: Help me with this code PLEASE Chris Angelico <rosuav@gmail.com> - 2013-11-06 09:03 +1100
  Re: Help me with this code PLEASE Piet van Oostrum <piet@vanoostrum.org> - 2013-11-05 18:15 -0400
    Re: Help me with this code PLEASE Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-06 00:35 +0200
      Re: Help me with this code PLEASE Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-06 00:45 +0000
        Re: Help me with this code PLEASE Ben Finney <ben+python@benfinney.id.au> - 2013-11-06 12:46 +1100
        Re: Help me with this code PLEASE Grant Edwards <invalid@invalid.invalid> - 2013-11-06 14:50 +0000
    Re: Help me with this code PLEASE Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-05 19:32 -0500

csiph-web