Lenny G. wrote:
> I use 's = os.read(fd, 12)' to grab 12 bytes from a file. Now, I want
> to create a string, s1, which contains 16-12=4 bytes: 4,0,0,0, followed
> by the contents of s.
>
> I know how to 's1 = "\x04\x00\x00\x00"' and how to 's3 = s1+s', but I
> don't know how to construct s1
I use 's = os.read(fd, 12)' to grab 12 bytes from a file. Now, I want
to create a string, s1, which contains 16-12=4 bytes: 4,0,0,0, followed
by the contents of s.
I know how to 's1 = "\x04\x00\x00\x00"' and how to 's3 = s1+s', but I
don't know how to construct s1 dynamically (i.e., given N, cons