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


Groups > comp.lang.python > #107763

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ethan Furman <ethan@stoneleaf.us>
Newsgroups comp.lang.python
Subject Re: Differences between Class(Object) and Class(Dict) for dictionary usage?
Date Wed, 27 Apr 2016 23:12:58 -0700
Lines 21
Message-ID <mailman.176.1461823904.32212.python-list@python.org> (permalink)
References <57216399.1050702@icloud.com> <57216EA8.4060600@gmail.com> <57217A2B.4060709@icloud.com> <57218905.5090807@gmail.com> <57218C42.5040804@icloud.com> <5721A9EA.1050205@stoneleaf.us>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de hffrqEIUM+cdHtzMCvCjGwhDmlQ1Up94qiKfZDcaQHSA==
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'format:': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'portable': 0.09; 'subject:Object': 0.09; 'file,': 0.15; 'subject: \n ': 0.15; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:between': 0.16; 'subject:usage': 0.16; 'variable.': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'file.': 0.22; 'wrote': 0.23; 'xml': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'notation': 0.29; 'url:wikipedia': 0.29; '~ethan~': 0.29; 'url:wiki': 0.30; 'mention': 0.30; 'another': 0.32; 'subject:) ': 0.32; 'class': 0.33; 'michael': 0.33; 'file': 0.34; 'handle': 0.34; 'could': 0.35; 'should': 0.36; 'url:org': 0.36; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'mean': 0.38; 'data': 0.39; 'format': 0.39; 'url:en': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'save': 0.60; 'your': 0.60; 'charset:windows-1252': 0.62; 'reverse': 0.66; 'state,': 0.66; 'saving': 0.70; 'funny': 0.83; 'configparser': 0.84; 'ini': 0.84; 'subject:Class': 0.91
User-Agent Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To <57218C42.5040804@icloud.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <5721A9EA.1050205@stoneleaf.us>
X-Mailman-Original-References <57216399.1050702@icloud.com> <57216EA8.4060600@gmail.com> <57217A2B.4060709@icloud.com> <57218905.5090807@gmail.com> <57218C42.5040804@icloud.com>
Xref csiph.com comp.lang.python:107763

Show key headers only | View raw


On 04/27/2016 09:06 PM, Christopher Reimer wrote:
> On 4/27/2016 8:52 PM, Michael Torrie wrote:

>>   In fact if it were me I would save game state to some kind of ini file,
>> which would mean manually going through each object and writing out the
>> relevant data to the ini file using the right syntax. And then reverse
>> the process when restoring from a file.  XML could be another format
>> used for your file, if you're into that kind of thing.
>
> Funny that you should mention the ini file. I wrote a ConfigParser class
> for my const['whatever'] variable. It wouldn't take much to use that in
> the meantime until I get a handle on pickle.

If you are saving chess game state, you should look at the Portable Game 
Notation format:

   https://en.wikipedia.org/wiki/Portable_Game_Notation

--
~Ethan~

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


Thread

Re: Differences between Class(Object) and Class(Dict) for dictionary usage? Ethan Furman <ethan@stoneleaf.us> - 2016-04-27 23:12 -0700

csiph-web