Sun, 01 Apr 2001 12:21:00 GMT, Tony Rentschler <tonyr at walterr.bellatlantic.net> pisze: > My first thought was to do something like this: > big_string = big_string + new_string. > > In practice, will this be inefficient? Yes. > That is, will Python malloc a new big_string each time I add a line? Yes. > Is there another way to handle this sort of situation, Yes: e.g. append strings to a list and join them at the end (using string.join or Python-2.0's ''.join(list)), or use the cStringIO module. -- __("< Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK
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