Skip to content

Instantly share code, notes, and snippets.

@mjota
Created November 26, 2013 16:32
Show Gist options
  • Select an option

  • Save mjota/7661475 to your computer and use it in GitHub Desktop.

Select an option

Save mjota/7661475 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: manuel
'''
import os
Home = os.getcwd()
Recurs = 3
Folders = 10
def creacio(current, rec):
if (rec == 0):
return
for n in range(0, Folders):
ncurrent = current + "/" + str(n)
os.mkdir(ncurrent)
open(current + "/f" + str(n), 'a').close()
creacio(ncurrent, rec - 1)
if __name__ == '__main__':
creacio(Home, Recurs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment