Append zip files together, just get the binary data (in memory)

2008-01-14 Thread BerlinBrown
Is it possible to just build the binary content of a zip file. I want to create the content in memory (e.g. return binary data) and then get those byte strings representing the zip file? Is that possible? Or could I possibly override functions in the zip class. 1. Create a zip file object (e.g.

Re: Append zip files together, just get the binary data (in memory)

2008-01-14 Thread BerlinBrown
On Jan 14, 5:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > BerlinBrown schrieb: > > > Is it possible to just build the binary content of a zip file. I want > > to create the content in memory (e.g. return binary data) and then get > > those byt

Is str/unicode.encode supposed to work? with replace/ignore

2008-01-15 Thread BerlinBrown
With this code, ignore/replace still generate an error # Encode to simple ascii format. field.full_content = field.full_content.encode('ascii', 'replace') Error: [0/1] 'ascii' codec can't decode byte 0xe2 in position 14317: ordinal not in ran ge(1

Replace stop words (remove words from a string)

2008-01-17 Thread BerlinBrown
if I have an array of "stop" words, and I want to replace those values with something else; in a string, how would I go about doing this. I have this code that splits the string and then does a difference but I think there is an easier approach: E.g. mystr = kljsldkfjksjdfjsdjflkdjslkf[BAD]Kkjkk