I have a bunch of Log Files (single liners), from these files I create a single file with their contents and update them them every n amount of time.
Example:
ID,PID ,PERCENTAGE
0 ,55666,10
1 ,55667,25
2 ,55668,45
3 ,55669,50
this file gets updated until the main processes are done.Only consistent value is the first member of the array (ID)
I am trying to create a progress bar for each on of these entries. Also these values can increase over time, since more are added as pool limit gets freed from an async task. So below code creates the output file above.
mylist = os.listdir(logPath)
mylist.remove('cmd.txt')
mylist= [logPath + s for s in mylist]
#print mylist , logPath
with open(logPath + "progess.out", 'w') as outfile:
for fname in sorted(mylist):
with open(fname) as (infile):
outfile.write(infile.read())
f = open(logPath + "progess.out")
lines = f.readlines()
for line in lines:
member = line.split(',')
print "WEDGEID:" + member[0] + " %" + member[3] + " Frame:" + member[2] + " MB:" + member[6]
time.sleep(2)
I thought about creating a table and populate it with these values, but I am kinda stuck.