Mark Lawrence wrote:
On 15/01/2016 15:55, jmp wrote:
Hi pyple !
In the UK it's "purple", a bit like "color" is wrong, it's "colour".
Now, let's not make fun of people with English as a second
language. That was obviously written with a Jäger accent:
http://girlgenius.wikia.com/wiki/J%C3%A4
Mark Lawrence wrote:
> On 15/01/2016 15:55, jmp wrote:
>> Hi pyple !
>
> In the UK it's "purple", a bit like "color" is wrong, it's "colour".
Yeah, you Brits are a deep purple.
(I thought I had already exhausted my allowance for lame jokes yesterday.
Seems I was wrong ;)
--
https://mail.pyth
On 15/01/2016 15:55, jmp wrote:
Hi pyple !
In the UK it's "purple", a bit like "color" is wrong, it's "colour".
I'd like to write a stream of bytes into a file. I'd like to use the
struct (instead of bytearray) module because I will have to write more
than bytes.
If you'd like to clarify
On 01/15/2016 05:08 PM, Tim Chase wrote:
[sorry, toddler on my lap clicked before I could type]
import struct
with open('toto', 'wb') as f: f.write(struct.pack('<4B', *[1,2,3,4]))
This one does what you want. The problem resides in your check:
I always end up with the following bytes on f
[sorry, toddler on my lap clicked before I could type]
> import struct
> with open('toto', 'wb') as f: f.write(struct.pack('<4B', *[1,2,3,4]))
This one does what you want. The problem resides in your check:
> I always end up with the following bytes on file:
> !hexdump toto
> 000 0201 0403
On 2016-01-15 16:55, jmp wrote:
> Hi pyple !
>
>
> I'd like to write a stream of bytes into a file. I'd like to use
> the struct (instead of bytearray) module because I will have to
> write more than bytes.
>
> let's say I want a file with 4 bytes in that order:
>
> 01 02 03 04
>
> None of the
On 15/01/2016 15:55, jmp wrote:
Hi pyple !
I'd like to write a stream of bytes into a file. I'd like to use the
struct (instead of bytearray) module because I will have to write more
than bytes.
let's say I want a file with 4 bytes in that order:
01 02 03 04
None of these work:
import struc
Hi pyple !
I'd like to write a stream of bytes into a file. I'd like to use the
struct (instead of bytearray) module because I will have to write more
than bytes.
let's say I want a file with 4 bytes in that order:
01 02 03 04
None of these work:
import struct
with open('toto', 'wb') as