At last i did it it was this wrong line file_count += len(files) ---it supposed to be file_count+=1 but thanks for help ya python masters .Steven Holden ,,,, thanks very very much for your tip about raw string
On Fri, Feb 27, 2009 at 12:43 PM, Gabriel Genellina <gagsl-...@yahoo.com.ar>wrote: > En Fri, 27 Feb 2009 07:02:57 -0200, lameck kassana <lkass...@gmail.com> > escribió: > > now it is working but i wonder it brings higher number of count as if it >> counts files in wholes computer can you check in my code and correct me >> ------------------------------------------------ >> import glob >> import os >> file_count=0 >> for files in >> glob.glob(r"\\192.168.0.45\loader\Files\file_log\v20090225<file:// >> 192.168.0.45/loader/Files/file_log/v20090225> >> *"): >> > > Add this line: > print files > > file_count += len(files) >> print 'Found', file_count, 'files in cwd' >> >> -------------------------------------------------------------------------------------------------------------------------------- >> >> the results are Found 435656 files in cwd --which is impossible since >> files >> are around six thousands daily. >> > > -- > Gabriel Genellina > > > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list