27

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

user3597719
  • 529
  • 1
  • 5
  • 10
  • 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

32
os.listdir(dir)

Also see List files in ONLY the current directory

ayhan
  • 64,199
  • 17
  • 170
  • 189
sorin
  • 149,293
  • 163
  • 498
  • 754