Re: combining the path and fileinput modules SOLVED

2006-11-25 Thread wo_shi_big_stomach
Dennis Lee Bieber wrote: > On Sat, 25 Nov 2006 07:58:26 -0800, wo_shi_big_stomach > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> File "p2.py", line 23, in ? >> for line in fileinput.input(f,): >> File >> "

Re: combining the path and fileinput modules

2006-11-25 Thread wo_shi_big_stomach
Gabriel Genellina wrote: > At Saturday 25/11/2006 00:14, wo_shi_big_stomach wrote: > >> > The filter should be applied to walkfiles. Something like this: >> > >> > dir = path(/home/wsbs/Maildir) >> > for f in filter(os.path.isfile, dir.walkfiles

Re: combining the path and fileinput modules

2006-11-24 Thread wo_shi_big_stomach
Gabriel Genellina wrote: > The filter should be applied to walkfiles. Something like this: > > dir = path(/home/wsbs/Maildir) > for f in filter(os.path.isfile, dir.walkfiles('*')): > # > # test: > # print f Thanks, this way f will print the full pathname/filename. But f a

Re: combining the path and fileinput modules

2006-11-23 Thread wo_shi_big_stomach
On 11/23/06 6:15 AM, Rob Wolfe wrote: > wo_shi_big_stomach wrote: >> Newbie to python writing a script to recurse a directory tree and delete >> the first line of a file if it contains a given string. I get the same >> error on a Mac running OS X 10.4.8 and FreeBSD 6.1. &g

combining the path and fileinput modules

2006-11-22 Thread wo_shi_big_stomach
Newbie to python writing a script to recurse a directory tree and delete the first line of a file if it contains a given string. I get the same error on a Mac running OS X 10.4.8 and FreeBSD 6.1. Here's the script: # start of program # p.pl - fix broken SMTP headers in email files # # recurses f