Size in byte of a string ?

Shagshag13 shagshag13 at yahoo.fr
Mon Jul 29 07:06:30 EDT 2002


[sorry for the previous incomplete post]

hello,

i had the following problem : i had huge files > 1,5 go. each of theses files contain some other small files and they are separate
by a header. i need to do some kind of random access to the small files so i wish to write a script which would build some kind of a
table of content for theses huges files.

i would like to have something like
samllfile_header_name_i : start_at_byte : end_at_byte

and i will do :
f.seek(start_at_byte)
samllfile_header_name_content = f.read(end_at_byte)

but to do this i need to be able at the building time to know how much bytes take a string ?

(i think there is something with the size in byte of CR/LF but how to measure it ? i hope i won't have to would prefer to do some
start_at_line, end_at_line as it will need to always read file from start...).






More information about the Python-list mailing list