retrieeving directory folders and sub folders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bskrishnan
    New Member
    • Aug 2007
    • 1

    retrieeving directory folders and sub folders

    I Need Code For Retrieving Folders And Sub Folders Usng Python. May Be According To A Specific Condition May Be Say Folder With Names Www Etc..
    Please Help
  • ghostdog74
    Recognized Expert Contributor
    • Apr 2006
    • 511

    #2
    Originally posted by bskrishnan
    I Need Code For Retrieving Folders And Sub Folders Usng Python. May Be According To A Specific Condition May Be Say Folder With Names Www Etc..
    Please Help
    Use the os.walk() method. See here

    Comment

    • robin746
      New Member
      • Aug 2007
      • 5

      #3
      It is helpful to wrap os.walk to create a custom generator. My version of this was published in the Python Cookbook, a must-have text for anyone working in the language. A simpler version is on my programming blog if you want a quick demonstration.

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by robin746
        It is helpful to wrap os.walk to create a custom generator. My version of this was published in the Python Cookbook, a must-have text for anyone working in the language. A simpler version is on my programming blog if you want a quick demonstration.
        Thanks, Robin. I checked out you site: It's quite nice and the link doesn't seem to violate any Posting Guidelines. I hope you stick around and grab a few questions along the way.

        Thanks for joining,
        Barton

        Comment

        Working...