On Jan 24, 4:02 pm, Donn Ingle <[EMAIL PROTECTED]> wrote: > > Try the fileinput module. > > I did give the fileinput module a go, but I can't find much info on it and > the help is ... well, it's python help ;)
Try http://effbot.org/librarybook/fileinput.htm > > > in goes to its stdin where it is processed if it has an argument of - > > fileinput works that way > > Okay, I did think of the dash, but did not know how to handle it. Is it a > bash thing or will that dash get passed into the args? (I am using getopt > to parse the options and args) - gets passed in and fileinput handles it. > > > which would work for ls and a python program using the fileinput > > module. > > Any examples of fileinput (that do not open each file) would be great! > (I'll go searching now anyway) fileinput is set to process each file a line at a time unfortunately. > > Thanks, Your welcome :-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list