Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
from time import time | |
import sys | |
def mksize (bytes): | |
suffixes = ("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") | |
suffixesLen = len(suffixes) | |
for i in range(suffixesLen): | |
if bytes < pow(1000, i + 1) or i + 1 == suffixesLen: | |
return "%.2f %s" % (float(bytes) / pow(1024, i), suffixes[i]) |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title> | |
<style> | |
body { | |
background: white; | |
text-align: center; |