Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2005

    trivial file system walker

    I copied the os.listdir() example to dump the list of files, their date and size to e:/filelog.txt for transferring to something with a bigger screen =)


  2. #2
    Registered User
    Join Date
    Jan 2005
    You might also take advantage of the function walk in the standard os.path library which can help you to write recursive file tree browsing code:

    >>> def callback(arg, dir, files):
    ... for file in files:
    ... print os.path.join(dir, file)
    >>> os.path.walk('c:', callback, None)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts