Paste P276

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Nov 29 2018, 3:58 PM.
import os
def createTestFile(filename):
x = open(filename, "w")
x.write("hello world")
x.close()
def createDir(path):
try:
os.mkdir(path)
except:
pass
root = "data2"
createDir(root)
for i in range(0,100):
path = root + "/dir" + str(i)
createDir(path)
for j in range(0, 100):
subPath = path + "/subdir" + str(j)
createDir(subPath)
for k in range(0, 100):
createTestFile(subPath + "/file" + str(k) + ".txt")
davidedmundson edited the content of this paste. (Show Details)Nov 29 2018, 3:58 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.