On 26/06/13 03:03, Matt D wrote:
meanwhile can you please take a look at this update() and tell me if you
see something wrong because ever sense I tried using the array for
logging the values from the TextCtrls the program is not updating
meaning when the program receives the c++ map, or the pic
On Tue, Jun 25, 2013 at 6:12 PM, Steven D'Aprano wrote:
> Why do you want to see rubbish like that inside your log file? Surely
> something like this is better?
>
> log.write("data = %r" % data)
>
> which will give you a line like this:
>
> data = {'a': None, 'b': 42}
>
>
> in your log, which is
On 26/06/13 04:30, Matt D wrote:
On 06/25/2013 01:54 PM, Alan Gauld wrote:
On 25/06/13 17:32, Matt D wrote:
self.data = data
with open('mypicklelog.txt','ab') as log: # open in binary mode
pickle.dump(self.data, log) # serialize data and write to
file
And I
>
> The real question is why do you want this pickle in a file? I am not sure
> it will be easy to pull out and reuse anyway. Given your experience level,
> I think this is a lot of work for something that you are unlikely to be able
> to easily use. I think it would be more useful to `log.wr
On 25/06/13 19:30, Matt D wrote:
Does the file exist?
Does it have anything in it?
Does self.data exist - what does it look like if you print it?
Are there any error messages?
Yeh nothing as in an empty file. The file is there but there is nothing
written in it.
OK, Try deleting the file an
On 06/25/2013 01:54 PM, Alan Gauld wrote:
> On 25/06/13 17:32, Matt D wrote:
>
>> self.data = data
>> with open('mypicklelog.txt','ab') as log: # open in binary mode
>> pickle.dump(self.data, log) # serialize data and write to
>> file
>>
>>
>> And I still get nothing
Again, please leave in attributions.
Matt D wrote:
> [Ramit Prasad wrote]
> >
> > Well I think self.data is some kind of container with a pickled string,
> > given the code to unpickle it is:
> >
> Exactly! This is what the C++ file 'pickle.h' creates to send to the
> Python GUI:
Not really.
>
On 25/06/13 17:32, Matt D wrote:
self.data = data
with open('mypicklelog.txt','ab') as log: # open in binary mode
pickle.dump(self.data, log) # serialize data and write to file
And I still get nothing.
Define 'nothing'.
Does the file exist?
Does it have anythi
Please leave attributions in so we know who is saying what.
Matt D wrote:
> [Ramit Prasad wrote]
> > [Peter Otten wrote]
> >
> > with open('mypicklelog.txt','ab') as log: # open in binary mode
> > pickle.dump(self.data, log) # serialize data and write to file
> >
> > where pickle.dump(obj, fil
>
> Well I think self.data is some kind of container with a pickled string,
> given the code to unpickle it is:
>
Exactly! This is what the C++ file 'pickle.h' creates to send to the
Python GUI:
/**
* A pickled Python dictionary. Used to pass stuff to the UI.
*/
class pickle
{
public:
>
> with open('mypicklelog.txt','ab') as log: # open in binary mode
> pickle.dump(self.data, log) # serialize data and write to file
>
> where pickle.dump(obj, file) converts `obj` to a sequence of bytes before it
> is written to `file`.
>
I put this like this:
class DataEvent(wx.PyEven
Peter Otten wrote:
> Matt D wrote:
>
> > On 06/24/2013 07:17 PM, Alan Gauld wrote:
> >> On 24/06/13 23:05, Matt D wrote:
> >>> I have been unable to find a way to write pickled data to text file.
> >>
> >> Probably because pickled data is not plain text.
> >> You need to use binary mode. However..
On 06/25/2013 07:28 AM, eryksun wrote:
> On Mon, Jun 24, 2013 at 6:57 PM, Steven D'Aprano wrote:
>>
>> You certainly shouldn't be writing pickle data to a log file! Firstly,
>> log files are usually opened in text mode, not binary mode, so it
>> probably won't work, and secondly even if it did wor
On Mon, Jun 24, 2013 at 6:57 PM, Steven D'Aprano wrote:
>
> You certainly shouldn't be writing pickle data to a log file! Firstly,
> log files are usually opened in text mode, not binary mode, so it
> probably won't work, and secondly even if it did work, you will be
> dumping a load of pickled bi
Matt D wrote:
> On 06/24/2013 07:17 PM, Alan Gauld wrote:
>> On 24/06/13 23:05, Matt D wrote:
>>> I have been unable to find a way to write pickled data to text file.
>>
>> Probably because pickled data is not plain text.
>> You need to use binary mode. However...
>>
>>
>>> def __init__(se
On 06/24/2013 07:17 PM, Alan Gauld wrote:
> On 24/06/13 23:05, Matt D wrote:
>> I have been unable to find a way to write pickled data to text file.
>
> Probably because pickled data is not plain text.
> You need to use binary mode. However...
>
>
>> def __init__(self, data):
>> wx
On Mon, Jun 24, 2013 at 3:48 PM, Matt D wrote:
> > def __init__(self, data):
> > wx.PyEvent.__init__(self)
> > # this line *binds* this class to a certain type of event,
> > wxDATA_EVENT
> > self.SetEventType (wxDATA_EVENT)
> > # and this is the actual data
>
On 24/06/13 23:05, Matt D wrote:
I have been unable to find a way to write pickled data to text file.
Probably because pickled data is not plain text.
You need to use binary mode. However...
def __init__(self, data):
wx.PyEvent.__init__(self)
self.SetEventType (wxDATA_
On 06/24/2013 06:05 PM, Matt D wrote:
> I have been unable to find a way to write pickled data to text file.
> My last attempt was to add the last two lines:
>
> # the dataevent class -- stores the data that gets transmitted when the
> event occurs.
> #it is the data in text fields, stored in sel
On Mon, Jun 24, 2013 at 06:05:37PM -0400, Matt D wrote:
> I have been unable to find a way to write pickled data to text file.
Normally you write pickled data to a file like this:
import pickle
data = {'something': 'goes', 'here': 42}
with open("/path/to/file/name.pickle", "rb") as f:
pickl
I have been unable to find a way to write pickled data to text file.
My last attempt was to add the last two lines:
# the dataevent class -- stores the data that gets transmitted when the
event occurs.
#it is the data in text fields, stored in self.data as a dictionary,
which is basically a c++ m
21 matches
Mail list logo