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
On Tue, Jun 25, 2013 at 2:04 PM, Walter Prins wrote:
> Hi Alexander
>
>
> On 23 June 2013 22:46, Alexander wrote:
>
>> I guess this is for testing, but I have a question. If somebody sends you
>> their .pub file (email or otherwise over internet), and a villainous third
>> party intercepts that
>
> 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
Hi Alexander
On 23 June 2013 22:46, Alexander wrote:
> I guess this is for testing, but I have a question. If somebody sends you
> their .pub file (email or otherwise over internet), and a villainous third
> party intercepts that .pub file, will they be able to decrypt the data sent
> over this
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 Tue, Jun 25, 2013 at 11:35 AM, Peter Otten <__pete...@web.de> wrote:
> eryksun wrote:
>
>> Constant folding for binary operations has a length limit of 20 for
>> sequences:
>>
>> >>> dis.dis(lambda: '0123456789' + '0123456789' + '0')
>> 1 0 LOAD_CONST 3 ('012345
eryksun wrote:
> Constant folding for binary operations has a length limit of 20 for
> sequences:
>
> >>> dis.dis(lambda: '0123456789' + '0123456789' + '0')
> 1 0 LOAD_CONST 3 ('0123456789
> 0123456789')
>
On Tue, Jun 25, 2013 at 10:11 AM, Peter Otten <__pete...@web.de> wrote:
>
> In older Pythons for ("alpha" "beta") the compiler would merge the two
> strings into one whereas ("alpha" + "beta") would trigger a str.__add__()
> call at runtime. Nowadays the peephole optimiser recognizes ("alpha" +
> "
Albert-Jan Roskam wrote:
> ___
>>From: eryksun
>>To: Jim Mooney
>>Cc: tutor@python.org
>>Sent: Tuesday, June 25, 2013 2:14 PM
>>Subject: Re: [Tutor] mistaken about splitting expressions over lines
>
>
>
>>
> a = ('this' # this way
>>... ' string' ' is lon
___
>From: eryksun
>To: Jim Mooney
>Cc: tutor@python.org
>Sent: Tuesday, June 25, 2013 2:14 PM
>Subject: Re: [Tutor] mistaken about splitting expressions over lines
>
> >>> a = ('this' # this way
> ... ' string' ' is long') # is more flexible
> >>>
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 9:58 PM, Dave Angel wrote:
>
> Alternatively, you can also use the statement continuation mechanism,
> whereby the last character of the line is a backslash. Using that approach
> you can break almost anywhere, except within a token or inside a string
> literal.
Also, the
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
22 matches
Mail list logo