Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import secrets
- import string
- def get_temp_file_name(a_file_name_length: int) -> str:
- return ''.join(secrets.choice(string.ascii_lowercase + string.digits) for _ in range(a_file_name_length))
- def generate_temp_file(a_file_name: str, a_length: int):
- with open(a_file_name, 'wb') as OUTFILE:
- OUTFILE.write(os.urandom(a_length))
- generate_temp_file(get_temp_file_name(8), pow(1024, 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement