Skip to content

Instantly share code, notes, and snippets.

@mwalzer
Created January 11, 2019 11:43
Show Gist options
  • Save mwalzer/e6b0e616da706f5faf14b79614230ba0 to your computer and use it in GitHub Desktop.
Save mwalzer/e6b0e616da706f5faf14b79614230ba0 to your computer and use it in GitHub Desktop.
import os
from hurry.filesize import size, si
filename = "test.txt"
limit = 1000000
var = "filenames.wiff"
with open(filename, 'w') as out:
for f in range(0,limit):
out.write(var + '\n')
s = os.path.getsize("/tmp/{x}".format(x=filename))
print(size(s, system=si))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment