Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os
- import sys
- import asyncio
- DEBUG = False
- async def make_dirs(path, depth):
- if not depth:
- return
- try:
- os.mkdir(path)
- except:
- pass
- for i in range(5):
- if random.randint(0, 100) > 25:
- dirpath = os.path.join(path, chr(65+i))
- if DEBUG:
- print(dirpath, end='\r')
- await make_dirs(dirpath, depth-1)
- if __name__ == "__main__":
- if '--debug' in sys.argv:
- DEBUG = True
- asyncio.run(make_dirs(str(random.randint(1, 10000000000000)), 10))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement