Movatterモバイル変換


[0]ホーム

URL:


string concatentation

Marcin 'Qrczak' Kowalczykqrczak at knm.org.pl
Sun Apr 1 09:29:59 EDT 2001


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 thecStringIO module.--  __("<  Marcin Kowalczyk *qrczak at knm.org.plhttp://qrczak.ids.net.pl/ \__/  ^^                      SYGNATURA ZASTĘPCZAQRCZAK


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp