I'm writing a program that reads individual lines of text from stdin, which is filled by piping the output from another program into mine. I need to collect the individual lines I've read into one large string. My first thought was to do something like this: big_string = big_string + new_string. In practice, will this be inefficient? That is, will Python malloc a new big_string each time I add a line? Is there another way to handle this sort of situation, say with a pre-allocated buffer of some kind? Thanks, Tony -- Tony Rentschler Senior Software Engineer The Associated Press 50 Rockefeller Plaza New York, NY 10020 (212) 621-1985 trentschler at ap.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4