human_file_size

astropy.utils.console.human_file_size(size)[source]

Returns a human-friendly string representing a file size that is 2-4 characters long.

For example, depending on the number of bytes given, can be one of:

256b
64k
1.1G
Parameters:
sizepython:int

The size of the file (in bytes)

Returns:
sizepython:str

A human-friendly representation of the size of the file