MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / human_size

Function human_size

DemoPrograms/Demo_Desktop_Widget_Drive_Usage.py:28–30  ·  view source on GitHub ↗

Returns a human readable string reprentation of bytes

(bytes, units=(' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'))

Source from the content-addressed store, hash-verified

26
27
28def human_size(bytes, units=(' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB')):
29 """ Returns a human readable string reprentation of bytes"""
30 return str(bytes) + ' ' + units[0] if bytes < 1024 else human_size(bytes >> 10, units[1:])
31
32
33def update_window(window):

Callers 2

update_windowFunction · 0.70
create_windowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected