building a large file

Thomas Duterme thomas at madeforchina.com
Sat Apr 14 04:09:00 EDT 2001


Hi everyone,

So I need to build a very large file.  Essentially, I need
to go through a directory and recursively append the
contents of each file from that directory to a file.

Here's what I'm doing right now:

for x in os.listdir('.'):
	os.system('cat '+x+' >> mylargefile)

Is there any smarter way to do this in python?

Thanks,
Thomas




More information about the Python-list mailing list