develop automated folder structure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nischalinn
    New Member
    • Mar 2014
    • 16

    develop automated folder structure

    I want to desing a automated folder structure script, when given the name of the root folder, the children folders along with the root folder are created automatically.

    The folder structure should be like this:

    ParentFolder
    --> 1. Child1 ==> GrandChild1, GrandChild2, GrandChild3
    --> 2. Child2
    --> 3. Child3

    Only the name of the ParentFolder will be given by the user and other folders name will be hard coded.

    How can I do it?

    Please can any one help me, do any one have any snippets for this?
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    The os module provides all the functionality to do what you want. os.makedirs(fil e_path) will recursively create nested directories. os.path.join(pa th1 [,path2 [, ...]]) will intelligently joint one or more path components into a complete path name.

    Comment

    Working...