"vinjvinj" wrote: > f = open(someFilePath, "rb") > content = [] > for data in content.read() > content.append(data) > fullContent = "".join(content) > > Is there a more efficient way of doing this?
read reads until end of file, so unless the source is something unusual, a plain fullContent = content.read() should be good enough (not that it matters much; that join will be in no-op, and the list/append overhead is marginal compared to the time required to get the data from disk) </F> -- http://mail.python.org/mailman/listinfo/python-list