Created
October 23, 2023 17:26
-
-
Save derekfrye/91a7be0db1da3e5492a804d99696d069 to your computer and use it in GitHub Desktop.
Random 1,550 MiB file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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