Hi,
I am a newbie in python. I have an data.pickle file which is
serialized form of an array of strings, I want to write their
offsets in another binary file, so an C++ program can read and analyse
them.
But when I try to write offset (number) in binary file, it raise
exception below in line
eskandari wrote:
Hi,
I am a newbie in python. I have an data.pickle file which is
serialized form of an array of strings, I want to write their
offsets in another binary file, so an C++ program can read and analyse
them.
But when I try to write offset (number) in binary file, it raise
exception
On 05/31/2010 10:56 AM, eskandari wrote:
But when I try to write offset (number) in binary file, it raise
exception below in line offsetfile.write(offset)
TypeError: argument 1 must be string or read-only buffer, not int
I search the internet, find that all suggest converting number to
string
On May 31, 12:30 pm, MRAB pyt...@mrabarnett.plus.com wrote:
eskandari wrote:
Hi,
I am a newbie in python. I have an data.pickle file which is
serialized form of an array of strings, I want to write their
offsets in another binary file, so an C++ program can read and analyse
them.
But
On 5/31/2010 12:43 PM, eskandari wrote:
On May 31, 12:30 pm, MRABpyt...@mrabarnett.plus.com wrote:
eskandari wrote:
Use the 'struct' module to convert the int to a bytestring, and remember
to open the file as a binary file.
Thanks alot,
I have an question, if I do so, Will the second
eskandari wrote:
On May 31, 12:30 pm, MRAB pyt...@mrabarnett.plus.com wrote:
eskandari wrote:
Hi,
I am a newbie in python. I have an data.pickle file which is
serialized form of an array of strings, I want to write their
offsets in another binary file, so an C++ program can read and