Jan-25-2017, 05:02 PM
Stripping out the GUI still gives the error:
Error:Traceback (most recent call last):
File "C:\Users\kb\Desktop\Python\test2.py", line 36, in <module>
for fred in total:
TypeError: 'float' object is not iterable
import os import math global file_path global total file_path = raw_input("location: ") filepaths = [] #gets list of avi for basename in os.listdir(file_path): filename = os.path.join(file_path, basename) if not filename.endswith(('.mov', '.AVI', '.avi')): continue if os.path.isfile(filename): filepaths.append(filename) # Re-populate list with size, convert to GB for i in xrange(len(filepaths)): filepaths[i] = (os.path.getsize(filepaths[i])) nums = filepaths[i] i = int(math.floor(math.log(nums, 1024))) p = math.pow(1024, i) s = round(nums/p, 2) total = s print total count = 0 for fred in total: fred= (s * .20) if fred > 4.5: count = count +1 print count