A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/091912.html below:

string concatentation

string concatentation string concatentationTony Rentschler tonyr 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, 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

More information about the Python-list mailing list

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