views:

39

answers:

1

I have wxpython application that run over a list of files on some directory and proccess the files line by line I need to build a progress bar that show the status how records already done with wx.gauge control
I need to count the number of the records before i use the wx.guage in order to build the progress bar , is this the way to do this and if yes what is the best method to count the number of lines of all the files on some directory with pyhon ?

+1  A: 

I think you could do 2 progress bars, one for files, and second for line in just read file. This will be similar to copy progress in TotalCommander.

If you want one progress bar you could just count file sizes using os.path.getsize(path) and then show how many bytes have you processed/bytes total.

Michał Niklas
Ok Thanks how can i know the size of the readed line with python ?
AKM
It is just `len(line)`
Michał Niklas