Movatterモバイル変換
[0]ホーム
string concatentation
Tony Rentschlertonyr at walterr.bellatlantic.net
Sun Apr 1 08:21:00 EDT 2001
I'm writing a program that reads individual lines of text from stdin, whichis filled by piping the output from another program into mine. I needto collect the individual lines I've read into one large string. My firstthought was to do something like this: big_string = big_string + new_string.In practice, will this be inefficient? That is, will Python malloc a newbig_string each time I add a line? Is there another way to handle this sortof situation, say with a pre-allocated buffer of some kind?Thanks,Tony-- Tony Rentschler Senior Software EngineerThe Associated Press 50 Rockefeller PlazaNew York, NY 10020 (212) 621-1985trentschler at ap.org
More information about the Python-listmailing list
[8]ページ先頭