[Python-talk] Pickling Question

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Fri Jul 17 14:55:41 EDT 2009


Pythonistas, I have some pickling questions.  I have been playing about 
with wxpython to 'beautify' an application I've been working on.

Currently I am storing (writing to file) the state of the radioboxes and 
choice widgets as they are generated.  Right now, I am just writing 
strings to file.  After the GO button is selected, I'd like to read the 
file and assign values to variables.  If I am thinking about this 
correctly, this is basically what a pickler can do for me.  Stop me here 
if I am dead wrong - I need to be set straight on this...

Here is the question/observation.  I have no control of what the user 
(that's me, or hopefully someone else) selects or reselects prior to GO. I 
would have every event logged (or pickled).  It is possible (probably 
likely) that the radiobutton selected in a radiobox would change.  Since I 
would pickle every event, does that mess things up, or does the last event 
win so to speak?

Lousy example
t0: rb1 = 1     # shorthand for rb1.value = 1 # this means: button 1 of 
radiobox 1 selected
t1: rb2 = 8
t2: rb3 = 3
t3: rb1 = 2     # here rb1 has button 2 selected... user changed their 
selection...
t4: rb4 = 4
t5: cb1 = '-40' # shorthand for cb1.value = -40 # choicebox1 selected 
value is -40
t6: cb2 = '-100'
t7: rb2 = 0
t8: cb1 = '-30'

where tn just represent different pickling events...

Reading back, would I (eventually) get

rb1 = 2
rb2 = 0
rb3 = 3
rb4 = 4
cb1 = '-30'
cb2 = '-100'   ?


Does pickling object rb1 written at time t0 get overwritten by the object 
rb1 written at time t3?

Am I on the right track here?  If not, any suggestions?

Thanks!
Bruce

******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************


More information about the Python-talk mailing list