Created
October 3, 2016 17:26
-
-
Save kickbase/85d51c8e0e9d3bc7d926778e9642ff6a to your computer and use it in GitHub Desktop.
create random file names
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 random | |
import string | |
def main(): | |
digit = 8 | |
for i in range(10): | |
random_str = ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(digit)]) | |
with open('out/{}.txt'.format(random_str), 'w') as f: | |
f.write('Hello') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment