Hello, I'm Lindie, and I’m a moderator for this topic.
We have been working with the professionals to try to help you with your question. Sometimes it may take a bit of time to find the right fit. I was checking to see if you had already found your answer or if you still needing assistance from one of the professionals. Please let me know if you wish to continue waiting or if you would like for us to close your question. Also remember that JustAnswer has a multitude of categories to help you with all your needs from Health, Pets, Computers, Cars, Finance, Law, to Home Improvement, and more. Thank you,
No answer yet. Thanks for checking in with me.
I just tried this as well. I almost have what I want. I am just missing how to combine the extensions and their file size.
I am getting results like this:
Extension .ico | Filesize 19790 bytesExtension .ico | Filesize 19790 bytesExtension .pyd | Filesize 132096 bytesExtension .dll | Filesize 73216 bytesExtension .pyd | Filesize 9728 bytes
I would like this to be more of a summary where the extension are listed only once with the file sizes summed. My script is below.
import osimport glob
for filename in glob.glob ('*'): filesize = os.path.getsize(filename) extension = os.path.splitext(filename) print("Extension",extension,"|","Filesize", filesize,"bytes")
Hello, Thank you, XXXXX XXXXX continue to look for a professional to assist you. Please let me know if I can be of any further assistance while you wait. Best,
Thank you for responding. I also need to include a count of the particular extension. This is a pretty long post and perhaps this requirment was lost. It is in the first post of mine. Do you think you would be able to include a count for the extension as shown below - just a number at the end of the row?
Extension .dll | Total space used (NNN) NNN-NNNNbytes | 2
Awesome. Thank you. I am not in a super rush and I can wait. No problem. I am new to programming and just can't figure out how to get the the file size, extension list, and count all together.
I did not think of min/max/average. I you could do that it would be great! That would be all I needed.