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 ?
views:
39answers:
1
+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
2010-09-21 08:25:57
Ok Thanks how can i know the size of the readed line with python ?
AKM
2010-09-21 10:53:43
It is just `len(line)`
Michał Niklas
2010-09-21 11:10:51