[FWTools] Python "batch" processing

Matt Wilkie matt.wilkie at gov.yk.ca
Thu Feb 25 11:45:45 EST 2010


The short answer is that python can do anything batch files can do, and 
more. That doesn't necessarily mean it's easier though, depends on what 
you know and how much time you have to learn.


--- print-csv.py ---
# print contents of each csv file in temp
import glob
for file in glob.glob('d:/temp/*.csv'):
     f = open(file)
     for line in f:
         print line
-------------------

more at http://docs.python.org/tutorial/inputoutput.html

cheers,

matt wilkie
--------------------------------------------
Geomatics Analyst
Information Management and Technology
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------


nlneilson wrote:
> I did a search for "batch" but did not find a direct answer regarding Python.
> 
> Can a Python .py app batch process files the same as with a .bat batch file?
> 
> I could have a .py app make a .bat file but I was wondering if a .py app
> could
> do this directly??


More information about the FWTools mailing list