How to concatenate external files ..?

David Goodger dgoodger at bigfoot.com
Thu Jun 29 23:01:44 EDT 2000


on 2000-06-29 04:20, Randolph MacKenzie (rmack at eznet.net) wrote:
> I want to combine all the little *.htm files in a directory into one big
> file.
...
> Now what  .. how do I iterate over the list and specify that each file is to
> be read and appended to "outfile" ?

If/when you get to the point where you want to do something to the file
contents, other than concatenate them together, take a look at the
"fileinput" module (docs in Python Library Reference).

-- 
David Goodger    dgoodger at bigfoot.com    Open-source projects:
 - The Go Tools Project: http://gotools.sourceforge.net
 (more to come!)




More information about the Python-list mailing list