Skip to content

Instantly share code, notes, and snippets.

@derekfrye
Created October 23, 2023 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekfrye/91a7be0db1da3e5492a804d99696d069 to your computer and use it in GitHub Desktop.
Save derekfrye/91a7be0db1da3e5492a804d99696d069 to your computer and use it in GitHub Desktop.
Random 1,550 MiB file
import os
import random
random.seed(0)
size = 1550 * 1024 * 1024
# Create a file with somewhat random data
with open(f"file_1", "wb") as file:
random_data = os.urandom(size)
file.write(random_data)
print(
f"Created file_1 with size {size/(1024*1024):.2f} MiB."
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment