How to automatically create 5 sub-directories using Python on Ubuntu?
i tried to create a .txt file with the folders name in it, than tried to execute the following command but its not working.
python -c 'import sys,os,codecs;[os.mkdir(d) for d in codecs.open(sys.argv[1],"r","utf8")]' subdirectory.txt
i believe this command will create folders in 1 folder instead of creating sub directories within a folder so i am wrong there
I am currently trying to perform this action on my Virtual box on my Ubuntu 12.04.
i would like to see my output to be
/home/user01/testdirectory/subdirectory
/home/user01/testdirectory/subdirectory/sub1
/home/user01/testdirectory/subdirectory/sub1/sub2
/home/user01/testdirectory/subdirectory/sub1/sub2/sub3
and so on
os.makedirs()instead ofos.mkdir