User Profile

Collapse

Profile Sidebar

Collapse
plotdevice
plotdevice
Last Activity: May 26 '10, 07:26 PM
Joined: May 26 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • How to compare filenames in directory against a textfile list

    I have a text file that has a frequently-changing list of filenames in it.

    exampleList.txt :
    Code:
    fee.doc
    fye.doc 
    foe.doc
    fum.doc
    ftangftang_ole_biscuitbarrel.doc
    I want to return True if the list exactly matches the files in a given directory.
    I want to return False if the directory contains files that are not in the list, and also if it only contains some but not all of...
    See more | Go to post

  • plotdevice
    replied to Counting Files in Directory
    gah! Thanks....
    See more | Go to post

    Leave a comment:


  • plotdevice
    replied to Counting Files in Directory
    Sorry for the thread necromancy, but I am in almost exactly the same situation as the OP. These solutions are not working for me. I don't know if it's because I'm having a brain eclipse, or what.

    This:
    Code:
    len([f for f in os.listdir('.') if os.path.isfile(f)])
    returns the correct number of files for the working directory. However,

    Code:
    where_to_look = '/home/user/files'
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...