29

How to list file names which are only from a particular directory? I don't want file names from sub-directory or anything.

user3597719
  • 567
  • 1
  • 5
  • 11
  • 4
    Duplicate: [How to list all files of a directory in Python](http://stackoverflow.com/q/3207219/5520354) – C14L May 27 '16 at 17:32

1 Answers1

34
os.listdir(dir)

Also see List files in ONLY the current directory

ayhan
  • 70,170
  • 20
  • 182
  • 203
sorin
  • 161,544
  • 178
  • 535
  • 806